Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   AFS/DDC/OLE: Function servers (http://www.baanboard.com/baanboard/forumdisplay.php?f=59)
-   -   Sales Quotation AFS continue opens a wrong subsession (http://www.baanboard.com/baanboard/showthread.php?t=70361)

Altrev 22nd August 2017 20:25

Sales Quotation AFS continue opens a wrong subsession
 
Hi,

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

mark_h 22nd August 2017 23:41

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?

Altrev 23rd August 2017 02:05

Hi Mark,
Unfortunately I do not have the source code of the api.
Thanks!

mark_h 23rd August 2017 15:05

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.

bhushanchanda 23rd August 2017 16:02

What version are you on? Also, moved the thread to the correct forum - AFS/DDC/OLE - Function servers

mark_h 24th August 2017 05:13

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.

Altrev 29th August 2017 19:16

Hi,
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:

select tdsls001.*
from tdsls001
where tdsls001.refa = :quote.item
order by tdsls001.refa
selectdo
sq.num = tdsls001.qono
endselect

with this select the following API works fine without the continue.process

tdslsf1101m000.handle.sub.process(prog.name$,"send")
tdslsf1101m000.put.Quotation_Number( sq.num )
ret = tdslsf1101m000.find(error.msg)

tdslsf1101m000.handle.sub.process("tdsls1107s000","add")
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()

tdslsf1107s000.end(error.msg)

tdslsf1101m000.end(error.msg)

Thanks Mark and Bhushan for your help.

Regards,


All times are GMT +2. The time now is 09:10.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com