Hi Everyone,[NAV 2009]
I have to update Custom field(Available inventory) of item table continuously. so, i created codeunit to run by jobqueue by every 5 min., but this activity became deadlock or this job became stop due to modifying anything in item table by another user.
My codeunit: with property: singleinstance=yes;
IF Item.FINDFIRST THEN
Item.CALCFIELDS(Inventory,"Qty. on Sales Order");
Item."Available Inventory" := Item.Inventory - Item."Qty. on Sales Order" - Item.Buffer;
UNTIL Item.NEXT = 0;
So, I tried to run codeunit directly by NAS.
for this I add code in codeunit:Application Management(1):
IF SRSetup."Run Available Inventory" THEN BEGIN
MESSAGE('NAS Available Inventory Started');
But ,this is now even updating the field. Once I restart the NAS-service,then only first time it use to update item table field after that not effecting. I check in Eventviewer,i am getting the MESSAGE 'NAS Available Inventory Started' as i put in codeunit 1 to run my codeunit.
Please check and guide me whether i am on right path or guide me further.
your help will be very-very appreciable..plse guide me.