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 cant 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
}
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
}