Error message when executing 'Ajust Cost - Item Entries'

LSANTOS
Member Posts: 3
When I execute the ‘Adjust Cost – Item Entries’ routine in the Inventory Module the program gives the following error message:
“Another user has modified the record for this Item after you retrieved it from the database. Enter your changes again in the updated window, or start the interrupted activity again. Identification fields and values: No.=’010001’”
This message only occurs when I’m working with SQL database. When I execute the referred transaction with a native navision database I do not have any problem.
Is it a conflict in the sql database? Can anyone give me a clue on this matter?
Thank you in advance
Luis Santos
“Another user has modified the record for this Item after you retrieved it from the database. Enter your changes again in the updated window, or start the interrupted activity again. Identification fields and values: No.=’010001’”
This message only occurs when I’m working with SQL database. When I execute the referred transaction with a native navision database I do not have any problem.
Is it a conflict in the sql database? Can anyone give me a clue on this matter?
Thank you in advance
Luis Santos
0
Comments
-
This seems that it is a bug. I sent it to MS but because I have no step-by-step reproduction doc. there is problem. But I found the point of wrong design in CU5895:
In codeunit 5895 procedure MakeSingleLevelAdjmt() is this Code (part): REPEAT Window.UPDATE(2,ItemLedgEntry."Item No."); ItemLedgEntry.SETRANGE("Item No.",ItemLedgEntry."Item No."); GetCostingMethod(Item,ItemLedgEntry."Item No.",CostingMethod); //1 IF CostingMethod = CostingMethod::Average THEN BEGIN AdjustCostApplied(ItemLedgEntry."Item No.",TRUE); //2 // Restart adjustment, if too many recursions WHILE LevelExceeded DO BEGIN LevelExceeded := FALSE; AdjustCostApplied(ItemLedgEntry."Item No.",TRUE); //2 END; AdjustAverage(ItemLedgEntry."Item No."); //2 END ELSE BEGIN AdjustCostApplied(ItemLedgEntry."Item No.",FALSE); //2 // Restart adjustment, if too many recursions WHILE LevelExceeded DO BEGIN LevelExceeded := FALSE; AdjustCostApplied(ItemLedgEntry."Item No.",FALSE); //2 END; END; IF (CostingMethod <> CostingMethod::Standard) AND (Item."No." <> '') THEN ItemCostMgt.UpdateUnitCost(Item,'','',0,0,TRUE,FALSE,FALSE); //3 ItemLedgEntry.FIND('+'); ItemLedgEntry.SETRANGE("Item No."); UNTIL (ItemLedgEntry.NEXT = 0) OR LevelExceeded;
Problem is that in line marked as //1 is filled the variable Item, on lines //2 are sometime called functions that change data on the item (but only item no. is passed) and on line //3 is Item variable modified = conflict, because between //1 and //3 was record changed in lines //2.
Solution - change part with //3:IF (CostingMethod <> CostingMethod::Standard) AND (Item."No." <> '') THEN BEGIN //Added BEGIN Item.GET(Item."No."); //Refresh Item card ItemCostMgt.UpdateUnitCost(Item,'','',0,0,TRUE,FALSE,FALSE); END; //added END;
We are using it without error now.0 -
Kine,
thank you very much. It solved my problem.0 -
Hi everybody,
we had the same problem using a SQL Server. We've got the answer that this seems to be a locktable-problem within SQL. MBS Support gave us some coding to fix the problem and it works as well (at least so far). The coding is the one that kine published at last but we didn't make any more changes. Maybe I should have a look at kine's coding as well...
Best regards,
N. GebhardProTAKT Projekte & Business Software AG
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt0 -
One more thing, which I noticed while looking through the published coding of Kine:
we were asked to use the code as it follows (didn't realize before that the line is "missing" in Kine's code).
IF (CostingMethod <> CostingMethod::Standard) AND (Item."No." <> '') THEN BEGIN //Added BEGIN
Item.LOCKTABLE; //ADD THIS LINE AS WELL
Item.GET(Item."No."); //Refresh Item card
ItemCostMgt.UpdateUnitCost(Item,'','',0,0,TRUE,FALSE,FALSE);
END; //added END;
We didn't have any error messages afterwards any more.
Regards,
N. GebhardProTAKT Projekte & Business Software AG
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt0 -
ngebhard, can I ask you from where you have this code? Was sent you from Microsoft?
I want to know, because when I sent them this problem, there was no solution for me and I sent them my code. :-)0 -
Hi Kine,
one of our customers migrated from native DB to sql DB and afterwards the error which LSANTOS described occured. We started a mbs support request (partnersource) about it and some support engineer gave this code to us. But we didn't need to fill out this paper from mbs (with the 9 pages) though it might not be an official feedback from Denmark but only from the support engineer. Don't know for sure...
Best regards,
N. GebhardProTAKT Projekte & Business Software AG
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt0 -
If it is code from support incident it is for me same as official patch. I only want to track the way of the code. I created support incident 1.11.2004 (dd.mm.yyyy;-)) including this workaround. I communicated with Endre B. May be that it was first incident for that. When you wrote your incident, they took the workaround, make fine-tuning (the locking) and sent it to you... OK, I am happy that MS support is working in this way... ;-)
I am posting this to show, how is MS support working and that you never know from where is the code... 8-[ :whistle:0 -
Kine I had similar experience, but it was related to localization. It's interesting that I communicated with Milan Schorovsky who is GTSC MBS Support Engineer in Prague! Maybe do you know him?®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions