jatin_sanghi
4th August 2004, 06:06
this is regarding customisation sessoin. We have one sales order session. I want to update the quantity after printing the sales order. For that, i wrote a small function and i called the same in 'after layout' of details section, but its' giving me an error 206 ' record is not locked' in db_update(51)

The function is as follows:

functions:
function quantity()
{
db.retry.point()
tdpur900.itqu = tdpur900.itqu - tdpur900.saqu
db.update( ttdpur900,db.retry)
commit.transaction()
}

Please, provide me with the assistance in this problem and where do i have to wirte this code.
Hoping for a quick revert back.

Regards,
Jatin Sanghi

kathuria
4th August 2004, 06:57
You have to open tdpur901 in update mode before update table.

e.g.

select tdpur901.*
from tdpur901 for update
where tdpur901.orno=:tdpur901.orno
where tdpur901.pono=:tdpur901.pono
selectdo
value
db.update(ttdpur901,db.retry)
commit.transaction()
endselect

Sanjay Kathuria