Sales Quotation AFS continue opens a wrong subsession
I have two BaaN companies, and each company opens a different Quotation Lines subsession due to setup when opening from the menu:
Company A: When using tdsls1101m000 and add lines the subsession tdsls1102s000 - Maintain Quotation Lines is opened
Company B: When using tdsls1101m000 and add lines the subsession tdsls1107s000 - Maintain Quotation Lines (Wholesale) is opened
But I'm using AFS to generate Sales Quotation, and being in Company B when I used the continue option the subsession opened is tdsls1102s000 instead of tdsls1107s000.
stpapi.continue.process( "tdsls1101m000", error )
Even if before I set the sub process to tdsls1107s000:
stpapi.handle.subproc( "tdsls1101m000", "tdsls1107s000","add")
Could someone have an idea why the continue process in AFS opens a different subsession that when using the Run Program?
Thanks in advance for your help
Not familiar with the sessions, but it is always possible that in 4c4 in api mode it skips some code that makes the tdsls1107s000 sub-session kick off instead of tdsls1102s000. Do you own source code to where you can debug it?
Unfortunately I do not have the source code of the api.
Well then that makes it a lot tougher - it could really be anything. I know in one session I had set something called boi.call before the function server would work. The only thing I can suggest is to run ttstpcreatdll to just create the DLL and just see what is in it. The other thing you could possible try is to do a save or an update on tdsls1101m000 before the continue. One of those commands might trigger a piece of code to set the subsession for the continue.
stpapi.update(tdsls1101m000", 1, error)
stpapi.handle.subproc( "tdsls1101m000", "tdsls1107s000","add")stpapi.continue.process( "tdsls1101m000", error )
Of course I assume in company b if you run tdsls1101m000 by hand and hit continue it launches the tdsls1107s000 using the data that would run thru the AFS code.
What version are you on? Also, moved the thread to the correct forum - AFS/DDC/OLE - Function servers
Bhushan - in the other forum it was 4c4. I was leaving it there just in case somebody on the functional side might know something to check.
Here is an Update, the continue process still opens the wrong session, this is what I had to do in order to open the correct session using API for Sales Quotations:
Before accessing the API I had to select the record table by code:
where tdsls001.refa = :quote.item
order by tdsls001.refa
sq.num = tdsls001.qono
with this select the following API works fine without the continue.process
tdslsf1101m000.put.Quotation_Number( sq.num )
ret = tdslsf1101m000.find(error.msg)
tdslsf1107s000.put.Quotation_Number( sq.num )
tdslsf1107s000.put.Position_Number.tdsls002.pono( sq.line.num )
tdslsf1107s000.put.Alternative( sq.altn )
tdslsf1107s000.put.Item( quote.item )
tdslsf1107s000.put.Planned_Delivery_Date( quote.date )
tdslsf1107s000.put.Ordered_Quantity( quote.qty )
tdslsf1107s000.put.Tax_Code( tax.code )
ret = tdslsf1107s000.insert( 1, error.msg )
sq.line.num = tdslsf1107s000.get.Position_Number.tdsls002.pono()
Thanks Mark and Bhushan for your help.
|All times are GMT +2. The time now is 09:10.|
©2001-2017 - Baanboard.com - Baanforums.com