fvdpbaan
5th September 2007, 14:29
Hello,

I'm trying to invoke session tipcf5120s000 from session tdsls4102s000 with AFS functionality. Session doesn't become active. I've added the part of the script that adds a sales orderline.

Item 38 is a generic item and after answering questioncode tdsls41045 with "yes" the session zooms to session tipcf5120s000 when you do this manually.

Has anyone an idea how to do this with AFS?

Kind regards,

Frank

function fill.afs.functions.tdslsf4102s000()
{
if first = 1 then
stpapi.handle.subproc("tdsls4101m000", "tdsls4102s000", "add")
stpapi.continue.process("tdsls4101m000", error.msg)
endif
stpapi.put.field("tdsls4102s000", "tdsls041.item", str$(38))
stpapi.handle.subproc("tdsls4102s000", "tipcf5120s000", "add")
stpapi.enum.answer("tdsls4102s000", "tdsls41045", tcyesno.yes)
stpapi.put.field("tipcf5120s000", "tipcf520.copt", tdvrk024.refa)
stpapi.application.option("tipcf5120s000", 1, 1, error.msg)
stpapi.enum.answer("tipcf5120s000", "tipcf51204", tcpcfa.end.program)
stpapi.enum.answer("tipcf5120s000", "tipcf51208", tcyesno.no)
stpapi.put.field("tdsls4102s000", "tdsls041.oqua", str$(tdvrk024.oqua))
stpapi.enum.answer("tdsls4102s000", "tdsls4102p", tcyesno.no)
stpapi.put.field("tdsls4102s000", "tdsls041.drct", str$(etol(tcyesno.no)))
stpapi.put.field("tdsls4102s000", "tdsls041.pric", str$(tdvrk024.pric))
stpapi.end.session("tdsls0130s000")
ret = stpapi.insert("tdsls4102s000", 1, error.msg)
}

mark_h
5th September 2007, 17:48
See this thread (http://www.baanboard.com/baanboard/showthread.php?t=15518&highlight=tipcf5120s000) that says it is not possible. I can not say if it is true or not since we do not use those sessions. I can say from looking at your code here:

stpapi.handle.subproc("tdsls4102s000", "tipcf5120s000", "add")
stpapi.enum.answer("tdsls4102s000", "tdsls41045", tcyesno.yes)
stpapi.put.field("tipcf5120s000", "tipcf520.copt", tdvrk024.refa)

That there is nothing to activate tipcf5120s000. I would expect to see some action(continue, zoom,save, etc.) taken on tdsls4102s000 that would activate the tipgc5120s000. Just doing a put.field usually does not work. How do you normally activate it from tdsls4102s000?

fvdpbaan
11th September 2007, 10:41
Hello Mark,

Thanks for the reaction. I saw the thread you refered to just after I posted my question. In this thread there is also a workaround. It says create a productvariant code with session tipcf5101m000. After creating this product variant you can assign it to a sales order and this works. Thanks again.

Best regards, Frank