DStroud
22nd December 2004, 23:16
I am trying to create an AFS session to load sales orders into Baan V and I am having a problem adding the sales order line if there is an inventory shortages for the item. When I do this manually there is a pop-up menu and I want to select “No Action” but I can’t figure out how to do this. I know in Baan IV that I would add “stpapi.handle.subproc("tdsls4101s000", "mtdsls000090461", "10")” .

Has anyone running Baan V got this to work? I would really appreciate any help.

Here is my code:


function process.order.line()
{
scan.ret = string.scan(in.buff,"%s|%s|%s|%s|%s",
in.order, | Old Order Number
in.pos, | Position (0=header)
in.item, | Item
in.qty, | Order Quantity
in.whse) | Warehouse
stpapi.handle.subproc("tdsls4100s000", "tdsls4501m000", "add")
stpapi.form.command("tdsls4100s000", 5, "to.lines", error.msg)
ret = stpapi.synchronize.dialog("tdsls4501m000", "add", error.msg)
if ret then
stpapi.put.field("tdsls4101s000", "tdsls401.pono", str$(in.pono))
stpapi.put.field("tdsls4101s000", "tdsls401.item.segment.1", "")
stpapi.put.field("tdsls4101s000", "tdsls401.item.segment.2", (in.item))
stpapi.put.field("tdsls4101s000", "tdsls401.oqua", str$(in.qty))
stpapi.put.field("tdsls4101s000", "tdsls401.cwar", in.whse)
ret = stpapi.insert("tdsls4501m000", true, error.msg)
if not ret then
rprt_send()
ret = stpapi.recover("tdsls4101s000", recover.msg)
else
error.msg = "Line Record Added"
rprt_send()
endif
endif
}

DStroud
7th January 2005, 22:41
Thanks to some help from Baan Support and friends at e-Emphasys I have got the AFS for loading sales order lines in Baan 5 working. The key was in how to handle the menu subprocess. The first issues is make sure you have the correct menu (in my case mtdsls00009047) there are several menus so make sure you select the correct one. Second is the Action ("13") in Baan 5 this is the menu sequence number divide by 10 (sequence number 130 = 13). So if you change the menu the AFS code may need to be changed.

Below is the actual handle for the subprocess that I used.

stpapi.handle.subproc("tdsls4101s000", "mtdsls00009047","13")

darpan
16th April 2005, 10:12
hi i want to update the Sales Export header Session "tdslsl140s000" it is fine for the first form but does'nt allow to go for next form.

Now how to go for the next form ...

please tell

Thanks and Regards

Darpan Bhansali

rochus
11th August 2006, 15:05
Somebody found a solution for ATP-check ?