You are here: Home // ICT_Skills // Baan Fatal Error 112 (No current record)

Baan Fatal Error 112 (No current record)

Baan Error 112 (No current record)This is just to remind myself how to fix of fatal error 112 to save for future. It happens when the query does not have a current record to commit to database.

 

It is very easy to fix since this is just a code error from the developers.

The original script:

function check.gvlot.table()
{
gvlot.company = get.compnr()

if gvlot.company <> 100 then
cmpok = switch.to.company(100)
endif

select    tdsls976.*
from    tdsls976 for update
where    tdsls976.bcmp = :gvlot.company
and tdsls976.btch = :arg.batch
and tdsls976.clot <> :tdltc001.clot
selectdo
tdsls976.clot = tdltc001.clot
db.update(ttdsls976)
commit.transaction()
endselect

cmpok = switch.to.company(gvlot.company)
}

Correct script:

function check.gvlot.table()
{
gvlot.company = get.compnr()

if gvlot.company <> 100 then
cmpok = switch.to.company(100)
endif

db.retry.point()
select    tdsls976.*
from    tdsls976 for update
where    tdsls976.bcmp = :gvlot.company
and tdsls976.btch = :arg.batch
and tdsls976.clot <> :tdltc001.clot
selectdo
tdsls976.clot = tdltc001.clot
db.update(ttdsls976, db.retry)
commit.transaction()
endselect

cmpok = switch.to.company(gvlot.company)
}

So it is very easy to just put one additional argument to the db.update!

Tags: , , , ,

2 Responses to " Baan Fatal Error 112 (No current record) "

  1. Malik says:

    It is always rare to find educated people about this matter, but you seem like you understand exactly what you are posting on! Appreciate it

Copyright © 2009 HAPPY RICKY. All rights reserved.
Designed by Theme Junkie. Powered by WordPress. Hosted by 3WBLOG.NET