Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
17%
200 - 500 GB
30%
500 - 800 GB
3%
800 - 1200 GB
7%
1200 - 1500 GB
10%
1500 - 2000 GB
13%
> 2000 GB
20%
Total votes: 30

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th March 2013, 16:50
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
AFS for LN Sales Quotations

I need a session to insert a new sales quote via AFS. Based on the code below I am able to create the header but the line insert fails. The error message I'm getting is "Enter a value for the Quotation field.". It appears that the provided quote number is not registered or is getting blanked out in the quotation lines session before the insert function call.

When manually creating a quote the sequence of sessions is as follows:
tdsls1500m000
tdsls1100s000
tdsls1501m000
tdsls1101s000

I show these indented to indicate the parent-child relationship. The process sequence when executing my AFS appears is this:
tdsls1500m000
tdsls1100s000
tdsls1501m000
tdsls1101s000

You can see that the last session - Sales Quotation Lines - is not spawned as a child. This may explain why tdsls1101s000 loses the value for tdsls101.qono and generates the error.

Here is the code:
tdslsdll1100.Quotation_Lines( error.msg )

tdslsdll1501.put.Quotation( evsls100.qono )
tdslsdll1501.set.view( "tdsls1501m000" )
tdslsdll1501.handle.sub.process( "tdsls1101s000", "add" )

tdslsdll1101.put.Quotation( evsls100.qono )
tdslsdll1101.put.Position( evsls101.pono )
rc = tdslsdll1101.find( error.msg )
populate.sls101.fields()

if rc = 1 then
rc = tdslsdll1101.update( true, error.msg )
else
rc = tdslsdll1101.insert( true, error.msg )
endif


Any advice on how to resolve this problem?
Reply With Quote
  #2  
Old 8th March 2013, 16:59
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
What is the AFS equivalent to double-clicking on a quotation line in an overview session of ERP LN? Double-clicking is the only way to get to the line detail.
Reply With Quote
  #3  
Old 8th March 2013, 21:02
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,137
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You can try stpapi.mark, but that just marks the record after the find. I do not think that is the equivalent of double clicking.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #4  
Old 8th March 2013, 21:17
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,137
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Something else to try is stpapi.continue, just to see if it initiates the lines. I can't really say since I do not use LN and they really recommend using DAL2 funtionality for LN. I just do not know enough about this stuff.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 8th March 2013, 23:50
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
Mark, thanks for your input. The quotation lines overview session does not have a 'Continue' choice. Instead I tried a 'stpapi.synchronized.dialog' call but that didn't help either.
Reply With Quote
Sponsored Links
  #6  
Old 9th March 2013, 01:03
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 415
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
This isn't for sales quotes, but it's the same idea. This is for entering a manual purchase invoice from maintain transactions:

Code:
stpapi.put.field( "tfgld1101m100", "tfgld101.year", str$(year.f) )
stpapi.put.field( "tfgld1101m100", "tfgld101.btno", curr.btno )

ret = stpapi.find( "tfgld1101m100", error )

stpapi.put.field( "tfgld1101m100", "tfgld101.ttyp", ttyp.f )

ret = stpapi.find( "tfgld1101m100", error)


if ret = 1 then
	ret = stpapi.mark( "tfgld1101m100", error)
	stpapi.form.command( "tfgld1101m100", 5, "enter.transactions", error)
...
I am not sure what the form command to zoom to lines is in sales quotes, but you should be able to find that by looking at the session in Maintain Sessions.

Hope it helps.

Vince
__________________
Vincent Murphy
---------------
ERP Practice Manager / Senior Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #7  
Old 10th March 2013, 15:59
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
Vince, I looked through all form commands but none of them launch tdsls1101s000.
Reply With Quote
  #8  
Old 10th March 2013, 16:43
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,356
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
May be this can help

SYNTAX
long stpapi.synchronize.dialog(string session, string mode, ref string err.mesg)
ARGUMENTS
session Name of the multi-occurrence session this command is executed on.
mode The mode in which the synchronized dialog box must be started. The possible values are:
Add – the dialog box is started and synchronized in Edit mode, view fields are sent from the multi-occurrence session to the single-occurrence session; use this mode before a stpapi.insert() call
Modify – the dialog box is started and synchronized in Edit mode, use this mode before a stpapi.update() call
display – the dialog box is started in Display mode
“ ” – no dialog box is synchronized (for future use when multi-occurrence and single-occurrence sessions have the same code, focus is set to the multi-occurrence session)
err.mesg This parameter will contain the text of the error message if the function cannot complete normally.
DESCRIPTION
This function synchronizes a multi-occurrence session with its registered synchronized dialog box. Depending on the mode, the session with the editable window is synchronized or the read-only window.
RETURN VALUES
0 Sessions could not be synchronized (err.mesg is filled)
1 Sessions are synchronized (err.mesg is empty)
EXAMPLE
stpapi.put.field("dtfsa1501m000", "dtfsa101.seno", str$(i.seno))
ret = stpapi.find("dtfsa1501m000", error.msg)
if ret then
ret = stpapi.synchronize.dialog("dtfsa1501m000", "modify", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.update("dtfsa1501m000", true, error.msg)
endif
endif
Explanation:
The record is searched in the multi-occurrence session. When found, the synchronized dialog box is started, the field changed, and the record updated.
Reply With Quote
  #9  
Old 11th March 2013, 10:45
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,356
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Using DAL

I found this code from my list. May be this will help you.
Pls note:- tdlvd401 is my customized table.
I am trying to insert a sales order line using DAL.


Code:
select	tdlvd401.*
	from		tdlvd401 for update
	where		tdlvd401._index1 = {:tdlvd400.netw, :tdlvd400.orno}
				and tdlvd401.proc = tcyesno.no
	selectdo
		target.item = get.target.item()
		db.retry.point()
		select	tdsls401.*
		from		tdsls401
		where		tdsls401._index1 = {:tdsls400.orno, :tdlvd401.pono }
		selectdo
		selectempty

			dal.new.object("tdsls401")
			dal.set.field("tdsls401.orno", tdsls400.orno )
			dal.set.field("tdsls401.ofbp", tdlvd411.bpid )
			dal.set.field("tdsls401.pono", tdlvd401.pono )
			dal.set.field("tdsls401.item", target.item )
			dal.set.field("tdsls401.qoor", tdlvd401.qoor )
			dal.set.field("tdsls401.cuqs", strip$(tdlvd401.cuqp) )
			dal.set.field("tdsls401.cups", strip$(tdlvd401.cuqp) )
			dal.set.field("tdsls401.pric", tdlvd401.pric )
		 	dal.set.field("tdsls401.porg",tdgen.porg.manual)	
			if tcibd001.kitm = tckitm.cost then
				dal.set.field("tdsls401.dltp", tdsls.dltp.sales )	
			else
				dal.set.field("tdsls401.dltp", tdsls.dltp.warehousing )	
			endif
			dal.set.field("tdsls401.odat", str$(utc.num()) )
			dal.set.field("tdsls401.ddta", str$(tdlvd401.ddta) )
			dal.set.field("tdsls401.cwar", tdsls039.cwar )
			dal.set.field("tdsls401.stbp", tdlvd411.bpid )
			ret = dal.save.object("tdsls401",db.return.error)
			if ret <> 0 then
				ret = dal.get.error.message(error.msg )
				seq.puts(concat$("|", "Error during SO line creation", tdlvd400.orno, tdlvd401.pono, target.item, error.msg), seq.log )
				error_found = TRUE
				abort.transaction()
			else
				if not isspace(tdlvd400.cprj) then
					update.project.parts()
				endif
				if ret = 0 then
					tdlvd401.proc = tcyesno.yes
					db.update(ttdlvd401, db.retry)
					commit.transaction()
				endif
			endif	
		endselect
	endselect
	
}

Last edited by bhushanchanda : 11th March 2013 at 10:47. Reason: Correction
Reply With Quote
  #10  
Old 12th March 2013, 03:57
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
I'll try that. Thanks, bhushanchanda.
Reply With Quote
  #11  
Old 12th March 2013, 17:15
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 415
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
The "to.lines" form command opens the tdsls1501m000 session.
__________________
Vincent Murphy
---------------
ERP Practice Manager / Senior Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #12  
Old 12th March 2013, 19:40
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
Yes, but there is not a form command to get from tdsls1501m000 to tdsls1101s000. I'm still playing with the synchronize.dialog function; it seems to do what I want it to do.
Reply With Quote
  #13  
Old 13th March 2013, 15:10
benito's Avatar
benito benito is offline
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 520
benito is on a distinguished road
Baan: LN 10.2.1 / LN 10.5 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
i only use AFS in LN sparingly. advantages of LN over BaanIV are the use of DAL, DLLs and Business Methods. i haven't done sales quotations but there is a DLL tdslsdll1100 (generate sales quotations). there are several functions in this DLL including tdsls.dll1100.add.header.record(..) and tdsls.dll1100.add.line.record(..). I suggest you explore them first.
Reply With Quote
  #14  
Old 27th March 2013, 21:56
kmcinc kmcinc is offline
Senior Member
 
Join Date: Feb 2003
Location: Canton, OH
Posts: 155
kmcinc is on a distinguished road
Baan: Triton, Baan IV, Baan V, ERP LN 6.1 - DB: Oracle, MS SQL, Informix - OS: Unix, Windows
Benito,

Thanks to your suggestion I was able to complete the quotation generation including lines, using the DLL you mentioned. It wasn't without a challenge but I got it working. Appreciate everybody's help with this problem!

-Tom
Reply With Quote
  #15  
Old 27th March 2013, 22:04
benito's Avatar
benito benito is offline
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 520
benito is on a distinguished road
Baan: LN 10.2.1 / LN 10.5 / BaanIVc4 - DB: Oracle11/Informix - OS: Unix/Linux
Talking

you're welcome. good to know it worked for you . again, the advantages of LN over the earlier version.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFS Sales Invoice -Baan 5 Predator AFS/DDC/OLE: Function servers 4 30th March 2008 15:51
Assigning sales position with AFS fallguyjg AFS/DDC/OLE: Function servers 5 18th August 2005 17:44
Extension to sales order header being updatesd thru AFS or update table will work darpan Tools Development 4 16th April 2005 10:16
AFS and sales orders tdsls4102s000 mstockre AFS/DDC/OLE: Function servers 3 6th December 2004 17:52
Sales order through AFS Debdas Banerjee AFS/DDC/OLE: Function servers 1 4th November 2004 17:39


All times are GMT +2. The time now is 17:36.


©2001-2018 - Baanboard.com - Baanforums.com