dmanicksd
30th July 2015, 18:02
Hi,
I try to update the purchase price using AFS. The sub-session, tdpur4107s000, is called from the main session, tdpur4101m000, using the activate command. I tried to use the stpapi.zoom.option(), and stpapi.application.option() and both doesn't work. Can you please suggest me how to activate the sub-session from main session? The code which I've written is pasted below for the reference please.
Thanks
----------------
stpapi.put.field("tdpur4101m000", "tdpur040.orno", str$(tdpur041.orno))
retval = stpapi.find("tdpur4101m000", error.msg)
if retval = 1 then
stpapi.handle.subproc("tdpur4101m000", "tdpur4107s000", "add")
|stpapi.zoom.option("tdpur4101m000", 1, "tdpur4107s000", error.msg)
stpapi.continue.process("tdpur4107s000", error.msg)
stpapi.put.field("tdpur4107s000", "tdpur041.orno", str$(tdpur041.orno))
stpapi.put.field("tdpur4107s000", "tdpur041.pono", str$(tdpur041.pono))
retval1 = stpapi.find("tdpur4107s000", error.msg)
if retval1 = 1 then
stpapi.put.field("tdpur4107s000", "tdpur041.pric", str$(pur.prip))
retval2 = stpapi.update("tdpur4107s000", true, error.msg)
if retval2 then
stpapi.get.field("tdpur4107s000", "tdpur041.pric", new.prip.p)
new.pur.pric = val(new.prip.p)
brp.ready(brp.id)
else
retval3 = stpapi.recover("tdpur4107s000", error.msg)
endif
endif
stpapi.end.session("tdpur4107s000")
endif
stpapi.end.session("tdpur4101m000")
-----------------
I try to update the purchase price using AFS. The sub-session, tdpur4107s000, is called from the main session, tdpur4101m000, using the activate command. I tried to use the stpapi.zoom.option(), and stpapi.application.option() and both doesn't work. Can you please suggest me how to activate the sub-session from main session? The code which I've written is pasted below for the reference please.
Thanks
----------------
stpapi.put.field("tdpur4101m000", "tdpur040.orno", str$(tdpur041.orno))
retval = stpapi.find("tdpur4101m000", error.msg)
if retval = 1 then
stpapi.handle.subproc("tdpur4101m000", "tdpur4107s000", "add")
|stpapi.zoom.option("tdpur4101m000", 1, "tdpur4107s000", error.msg)
stpapi.continue.process("tdpur4107s000", error.msg)
stpapi.put.field("tdpur4107s000", "tdpur041.orno", str$(tdpur041.orno))
stpapi.put.field("tdpur4107s000", "tdpur041.pono", str$(tdpur041.pono))
retval1 = stpapi.find("tdpur4107s000", error.msg)
if retval1 = 1 then
stpapi.put.field("tdpur4107s000", "tdpur041.pric", str$(pur.prip))
retval2 = stpapi.update("tdpur4107s000", true, error.msg)
if retval2 then
stpapi.get.field("tdpur4107s000", "tdpur041.pric", new.prip.p)
new.pur.pric = val(new.prip.p)
brp.ready(brp.id)
else
retval3 = stpapi.recover("tdpur4107s000", error.msg)
endif
endif
stpapi.end.session("tdpur4107s000")
endif
stpapi.end.session("tdpur4101m000")
-----------------