popeye
4th February 2002, 23:26
Hi,
I am using Function Server for deleting Purchase Order lines.
When I do a find(), I get a return value of 1.
1 = Record found.
But when I do a get() for the order and position, I get
different values. Basically it goes to the first Purchase Order/Line.
Why is this happening?
I have attached a snapshot of my debug screen for your
perusal. Check the value of hold.orno, hold.pono, tmp.orno and tmp.pono.
Here is the script.
Check the |.new and |.old lines.
Thanks.
+++++++++++++++++++++++++++++++++++
function extern domain tcbool tdpurodll00001.delete.po.line(domain tcorno hold.orno,
domain tcpono hold.pono,
ref domain tcmcs.str100 hold.error)
{
long ret
domain tcorno tmp.orno
domain tcpono tmp.pono
hold.error = ""
stpapi.enum.answer("tdpur4105s000", "ttstpq0100", ttyeno.yes)
stpapi.handle.subproc("tdpur4105s000","tdpur5106s000","kill")
f4105s000.put.Purchase_Order(hold.orno)
f4105s000.put.Position_Number(hold.pono)
ret = f4105s000.find()
|if ret = 1 then | .old
tmp.orno = f4105s000.get.Purchase_Order() | .new
tmp.pono = f4105s000.get.Position_Number() | .new
if tmp.orno = hold.orno and tmp.pono = hold.pono then | .new
f4105s000.delete(0, hold.error)
if not isspace(hold.error) then
f4105s000.end()
return(FALSE)
endif
else
hold.error = "Purchase Order not found"
f4105s000.end()
return(FALSE)
endif
f4105s000.end()
return(TRUE)
}Code tags (http://www.baanboard.com/baanboard/misc.php?s=&action=bbcode) added.
~Vamsi
I am using Function Server for deleting Purchase Order lines.
When I do a find(), I get a return value of 1.
1 = Record found.
But when I do a get() for the order and position, I get
different values. Basically it goes to the first Purchase Order/Line.
Why is this happening?
I have attached a snapshot of my debug screen for your
perusal. Check the value of hold.orno, hold.pono, tmp.orno and tmp.pono.
Here is the script.
Check the |.new and |.old lines.
Thanks.
+++++++++++++++++++++++++++++++++++
function extern domain tcbool tdpurodll00001.delete.po.line(domain tcorno hold.orno,
domain tcpono hold.pono,
ref domain tcmcs.str100 hold.error)
{
long ret
domain tcorno tmp.orno
domain tcpono tmp.pono
hold.error = ""
stpapi.enum.answer("tdpur4105s000", "ttstpq0100", ttyeno.yes)
stpapi.handle.subproc("tdpur4105s000","tdpur5106s000","kill")
f4105s000.put.Purchase_Order(hold.orno)
f4105s000.put.Position_Number(hold.pono)
ret = f4105s000.find()
|if ret = 1 then | .old
tmp.orno = f4105s000.get.Purchase_Order() | .new
tmp.pono = f4105s000.get.Position_Number() | .new
if tmp.orno = hold.orno and tmp.pono = hold.pono then | .new
f4105s000.delete(0, hold.error)
if not isspace(hold.error) then
f4105s000.end()
return(FALSE)
endif
else
hold.error = "Purchase Order not found"
f4105s000.end()
return(FALSE)
endif
f4105s000.end()
return(TRUE)
}Code tags (http://www.baanboard.com/baanboard/misc.php?s=&action=bbcode) added.
~Vamsi