bansaanu
13th June 2012, 23:05
Hi,
I am trying update price in sales order line(tdsls4102s000) and the extension of sales order line(tdslsl102s002). Afs works for sales order line but it is not updating price at tdslsl102s002. Following is the code which I am using:


select tdsls045.*
from tdsls045
where tdsls045._index1 inrange {:orno.f,:pono.f,0} and {:orno.t,:pono.t,0}

selectdo

stpapi.put.field( "tdsls4101m000", "tdsls040.orno", str$(tdsls045.orno))
stpapi.put.field( "tdsls4101m000", "tdsls040.pono", str$(tdsls045.pono))
stpapi.find( "tdsls4101m000", error )


stpapi.handle.subproc( "tdsls4101m000", "tdsls4102s000", "send")

stpapi.continue.process( "tdsls4101m000", error )

stpapi.put.field( "tdsls4102s000", "tdsls041.orno",str$(tdsls045.orno))
stpapi.put.field( "tdsls4102s000", "tdsls041.pono",str$(tdsls045.pono))
stpapi.find( "tdsls4102s000", error )
stpapi.put.field( "tdsls4102s000", "tdsls041.pric",str$(100.25))
stpapi.update( "tdsls4102s000", 1, error )

| stpapi.end.session("tdsls4102s000", error)

stpapi.handle.subproc( "tdsls4102s000", "tdslsl102s002", "add")
stpapi.zoom.option( "tdsls4102s000",1,"tdslsl102s002", error)
stpapi.put.field( "tdslsl102s002", "tdind017.orno",str$(tdsls045.orno))
stpapi.put.field( "tdslsl102s002", "tdind017.pono",str$(tdsls045.pono))
stpapi.find( "tdslsl102s002", error )
| stpapi.put.field( "tdslsl102s002", "tdind017.bdat",str$(temp.dat))
stpapi.put.field( "tdslsl102s002", "tdind017.assv",str$(123))

stpapi.update( "tdslsl102s002", 1, error )
| stpapi.continue.process( "tdslsl102s002", error )

stpapi.end.session("tdslsl102s002", error)
stpapi.end.session("tdsls4102s000", error)
stpapi.end.session("tdsls4101m000", error)

endselect

Please let me know your thought.


Thanks,
Anubhav

mark_h
14th June 2012, 00:16
Can't help much, but have you searched this forum for the tdsls1102s002 session? I found this link here (http://www.baanboard.com/baanboard/showthread.php?t=15329&highlight=tdslsl102s002) which might help. I will not be much use since we do not use those sessions.

Now one question I can ask is do you have to use a subsession(tdsls1102s002)? Is there a main session you might be able to use? The code you posted looks reasonable, but since we do not have the session I do not know which command might actually work for the update. I know sometimes a save works in place of the update, just something you can try.

shahudit
14th June 2012, 11:43
Hi

If your issue is not resolved then you can try writing the below command after stpapi.zoom.option() command. Your code will not call cont.process of tdsls4102s000 without it and may not update the price.

stpapi.continue.process("tdsls4102s000", error)

Regards