Alfonso Monsalv
8th October 2018, 23:36
Hi everybody:
How I can execute a command from the program script in Infor-LN ?

See details:
I have a program script that I need to execute a command from the program script code.
I want a process a Warehosing Order.

Do you know how to do it ?

My code Below:

function process.warehousing.order()
|this function process the Warehousing Order if the header status is not received .
{
err.msg = ""
stpapi.put.field("whinh2100m100", "whinh200.oorg", str$ (whinh200.oorg))
stpapi.put.field("whinh2100m100", "whinh200.orno", str$ (whinh200.orno))
stpapi.put.field("whinh2100m100", "whinh200.oset", str$ (whinh200.oset))
afs_ret = stpapi.find("whinh2100m100", err.msg)
if afs_ret = 1 then
stpapi.form.command("whinh2100m100", 5, "automatic.process", err.msg) |call the process function from this session
if not isspace(err.msg) then |--Error Message Location does not Exist
rprt_send()
else
err.msg = "Order Not Process / Lines not found for the Warehousing Order "
rprt_send()
endif
stpapi.end.session("whinh2100m100")

stpapi.end.session("whinh2100m100")
else
err.msg = "Warehousing Order not Found in the table "
rprt_send()
endif
}

mark_h
9th October 2018, 15:17
Well can't really help since we are 4c4, but one of the things they do recommend for LN is using DAL2 functionality. You can try searching in this forum for how to do that.

From just glancing at the code I do not see any glaring issues. Does it find the record? Or where exactly is the error occurring?

Alfonso Monsalv
9th October 2018, 23:01
Thank you very much.
I will do it with DAL.