mrabhiram
26th June 2014, 09:10
Hi i am trying to generate receipts using AFS. At one point i am struck.



stpapi.put.field("tdpur4120m000", "form.dino", packingslip)
stpapi.handle.subproc("tdpur4120m000", "tdpur4131s000", "add")

stpapi.put.field("tdpur4131s000", "tdpur045.suno", supplier)

check = stpapi.browse.set("tdpur4131s000", "first.set", check)

while check
stpapi.get.field("tdpur4131s000", "tdpur045.orno", orno)
stpapi.get.field("tdpur4131s000", "tdpur045.pono", pono)

if input.orno = orno and input.pono = pono then
ret = stpapi.mark("tdpur4131s000", err.msg)

endif
check = stpapi.browse.set("tdpur4131s000", "next.set", check)
endwhile
if ret then
stpapi.continue.process("tdpur4131s000", err.msg)
endif
stpapi.end.session("tdpur4131s000")

stpapi.put.field("tdpur4120m000", "tdpur045.orno", input.orno)
stpapi.put.field("tdpur4120m000", "tdpur045.pono", input.pono)
ret = stpapi.find("tdpur4120m000", err.msg)

if ret then
stpapi.put.field("tdpur4120m000", "tdpur045.diqu", shipdqnty)
stpapi.put.field("tdpur4120m000", "tdpur045.date", transdate)
stpapi.put.field("tdpur4120m000", "tdpur045.dqua", recvdqnty)
ret = stpapi.insert("tdpur4120m000", true, err.msg)
if not ret then
ret = stpapi.recover("tdpur4120m000", recover.msg)
endif
endif
stpapi.end.session("tdpur4120m000")

}

I am able to open the subsession "tdpur4131s000" and enter supplier number. But i am not able to get the list after that. Manually, after entering the supplier number, we press "tab" to get the list of PO's on the form. How to achieve that using AFS?

bhushanchanda
26th June 2014, 15:21
Hi,

I am not aware of the session but you if tdpur4120m000 session has view fields, try using stpapi.change.view() instead of find.

Also, check if you are inserting all the fields required for searching the records.

A solution from Mark :- Thread (http://www.baanboard.com/baanboard/showthread.php?t=15618&highlight=tdpur4120m000)

Here are related threads:-

Thread 1 (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1138)

Thread 2 (http://www.baanboard.com/baanboard/showthread.php?p=29651)

Thread 3 (http://www.baanboard.com/baanboard/showthread.php?p=182292)