lehighwiz
8th October 2002, 16:32
I am trying to use an API to automate the session Maintain Outbound Data. No matter what data i pass to the fields on the insert portion of the form, i get the error "No inventory of [ITEM] [LOT] for the specified date" (where [ITEM] and [LOT] are my entered item and lot). Here is a snippet of my code that i am using. Any suggestions would be greatly appreciated.

Matt


stpapi.put.field(api.subsession.1, "tdilc401.pono", "10")
stpapi.put.field(api.subsession.1, "tdilc401.clot", "MVB00132")
stpapi.put.field(api.subsession.1, "tdilc401.date", "10082002")
stpapi.put.field(api.subsession.1, "tdilc401.loca", "RECEIPT")
stpapi.put.field(api.subsession.1, "tdilc401.qstr", "40")
rc = stpapi.insert(api.subsession.1, 1, api.err.msg)

if i key this exact data into the session, then everything works just fine.

gfasbender
8th October 2002, 18:25
Does the session have a type 3 form? If a record is inserted with a type 3 form, the function stpapi.change.view must be called to set the correct key field values.

gous99
8th October 2002, 20:21
Try entering the same data manually in your session and see if you get the same error, maybe there is no inventory for the given item/lot?

ulrich.fuchs
10th October 2002, 07:15
I think you will have to enter the date value as a "stringed" value of the long value that Baan (4) internally uses for dates.
So, instead of "10082002" use
str$(date.to.num(2002, 08, 10)) and it should work fine (I hope)

Uli