gtuser
30th May 2006, 22:51
We are able add headers for sales order tdsls4101m000 using AFS. But we get the error message "Input cancelled on field ordered quantity". This just happens to be the last field before we try to populate the table.

We can manually enter this order with no problem. The only pop up we get is for insuff inventory. Could anyone tell me by looking at my code below if there is something else that I need to add to make sure I have that pop up covered?


Here is a sample of our coding for the sub session:


function run.sub.sess()
{
|*** This function invokes sub-session tdsls4102s001 and updates the
|*** quantity field

stpapi.handle.subproc( "tdsls4101m001", "tdsls4102s001", "add")
stpapi.continue.process("tdsls4101m001",error.msg)
stpapi.handle.subproc("tdsls4102s001", "mtdsls000090451", "10")

work.pono = "2"
error.msg2 = ""

stpapi.put.field("tdsls4102s001", "tdsls041.orno",work.orno)
stpapi.put.field("tdsls4102s001", "tdsls041.pono",str$(2))
|stpapi.put.field("tdsls4102s001", "tdsls041.pono",str$(3))
stpapi.put.field("tdsls4102s001", "tdsls041.cuno",cuno)
stpapi.put.field("tdsls4102s001", "tdsls041.eseq",eseq)
stpapi.put.field("tdsls4102s001", "tdsls041.item",work.item)
stpapi.put.field("tdsls4102s001", "tdsls041.oqua",oqua)

retval1 = stpapi.insert("tdsls4102s001",1 ,error.msg)
if not retval1 then
message("tdsls4102s001 Order Lines = %s ", error.msg)
error.msg2 = error.msg
retval2 = stpapi.recover("tdsls4102s001", error.msg)
all.ok = false

endif

|if error.msg2 <> "" then
| rprt_send()
|endif

stpapi.end.session("tdsls4102s001")
stpapi.end.session("tdsls4101m001")
stpapi.end.session("tdsls4503s001")

}

Thank you,

Mar

mark_h
1st June 2006, 05:39
Is oqua a string field?

mark_h
1st June 2006, 05:42
Also check out this thread (http://www.baanboard.com/baanboard/showthread.php?t=5833&page=2&highlight=mtdsls000090451). Look at the one be Dstroud - I really have not used menus, but on search on mtdsls000090451 returned this post and a couple of others.

gtuser
2nd June 2006, 15:46
Mark,

Thank you for your support. I found out what it was. In sales order parameter there was one flag I needed to set. tdsls4100m000 "Time-Phases Inventory check" needed to be set to "Yes".