patwanirav
25th July 2013, 15:12
I am getting error when i am inserting outbound lines for the warehouse order through AFS.

while stpapi.insert is executed it gives me message item field is not filled, but when i see the value of item in debug it shows there. The code which i had written is as under.

stpapi.put.field("whinh2100m000","whinh200.oorg", str$(oorg))
stpapi.put.field("whinh2100m000","whinh200.orno", str$(orno))
stpapi.put.field("whinh2100m000","whinh200.oset", str$(oset))
ret = stpapi.find("whinh2100m000", err.msg)
if isspace(err.msg) then
ret = stpapi.mark("whinh2100m000", err.msg)
stpapi.form.command("whinh2100m000", 5, "to.outbound.lines", err.msg)

ret = stpapi.synchronize.dialog("whinh2120m000", "add", err.msg)

if isspace(err.msg) then
stpapi.put.field("whinh2120m000","whinh220.item", str$(item))
stpapi.put.field("whinh2120m000","whinh220.clot", str$(clot))
stpapi.put.field("whinh2120m000","whinh220.qoro", str$(qoro))
stpapi.put.field("whinh2120m000","whinh220.orun", str$(orun))
ret = stpapi.insert("whinh2120m000", 1, err.msg)
if isspace(err.msg) and ret = 1 then
else
message("Error : %s", err.msg)
ret = stpapi.recover("whinh2120m000",err.msg)
endif
else
message("Error : %s", err.msg)
endif
else
message("Error : %s", err.msg)
endif
stpapi.end.session("whinh2120m000")
stpapi.end.session("whinh2100m000")

Kindy help me pls ....

mark_h
25th July 2013, 15:49
This is the correct forum for questions about AFS. See if this thread (http://www.baanboard.com/baanboard/showthread.php?t=25556&highlight=whinh2120m000) helps any.

Some other questions - is this a segmented item? Can you put the baan sessions in debug mode to see what happens in it?

bhushanchanda
25th July 2013, 17:14
Yes Mark it is a segmented field.

Patwanirav,

You can try like this:-

stpapi.put.field( "whinh2120m000", "whinh220.item.segment.1", "" )
stpapi.put.field( "whinh2120m000", "whinh220.item.segment.2", item(10; 38) )

patwanirav
26th July 2013, 06:04
Thanks mark and bhushanchanda.
Actually i am not aware of that in afs we have to pass values as per the segment. After putting value as per the segment its working fine.

Thank you once again... :)