Hi,
I have a request for importing item tracking serial numbers from an excel spreadsheet using a new function in the Item tracking lines Form. I searched the forum and found that the only way is to import the Serial Nos to new entries in the reservation entry table. My problem is that when i import the lines from the Item Tracking Form i have an error "Another user has modified the record" because when this form starts it locks the reservation entries table. #-o Anyone has developed this?
Thanks in advanced
0
Comments
The Item Tracking part is by far the worst design part of Navision and hard to make changes to.
Where do you want to assign these? In the manufacturing process? Or Purchassing? What is the Form number, and what code did you write?
Sorry i should have posted more info. The process is to import Serial Nos from an excel spreadsheet to the Purchase Order Lines. The user must go to the Purch Order -> Line -> Item Tracking Lines and open form 6510. Then it should have a function (in functions button) called "Import Tracking Lines" that should create the tracking lines from the specified spreadsheet. Excel spreadsheet will have only one column "Serial No.", quantity will always be 1.
Thank you
Can you share the code that you have created?
It has been ages since I've worked with reservations, but maybe reading the code it will ring a bell.
I have a function at F6510 Item Tracking Lines that calls a reports to write the serial numbers to the reservation entry table. But when F6510 is closed this standard code runs:
F6510 Item Tracking Lines
This error is returned:
Microsoft Dynamics NAV Classic
Another user has modified the item tracking data since it was retrieved from the database.
Start again.
OK
It's by far the most dramatically designed form in Navision ever.
I would create a new codeunit with the purchase line as parameter that creates the reservation entries, completely skipping the code in form 6510.
This does require thourough knowledge of the reservation engine.
I wrote a codeunit to create reservation entries that is called by web services. You should look at existing tracking lines created for the various scenarios you wish to support.
Receipts and shipments can be generated from multiple places and the data in the corresponding entries will vary accordingly.
http://mibuso.com/blogs/davidmachanick/
You may want to use the Create Reserv. Entry codeunit, and the two functions CreateReservEntry.CreateReservEntryFor & CreateReservEntry.CreateEntry.
Basically, by calling those two functions, you can properly create an item tracking line for an document. In the following example, we are automatically creating an item tracking line for the full quantity of the purchase line. It might not match exactly what you need, but if you allowed the user to enter or import many item tracking details per documetn line, you woudl just loop this code changing the quantity, lot & serial. It then creates the reservation entry properly.
CreateReservEntry.CreateReservEntryFor(DATABASE::"Purchase Line",
SubType,
"Document No.",'',
0,"Line No.","Qty. per Unit of Measure",
"Quantity (Base)" - TrackingSpec."Quantity (Base)",
'',{this is the serial number parameter}
LotNo); //this field we figured out based on setup
CreateReservEntry.CreateEntry("No.","Variant Code","Location Code",'',
PurchHeader."Expected Receipt Date",0D,0,
ResStatus);
The problem with the item tracking form is that it is based on temporary tables, which group item ledgers together, and it makes it very hard to see what is going on until the form is clsoed, then the reservation engine lopps & groups and creates item tracking records. The other issue with this form is that you have to close it to go to the next line - if your customers use a lot of item tracking, this process becomes unuable, especially during inventory selection. Imagine a 20 line sales order, with 5 different lots being selected per sales line. You go to the line, open item tracking, open select entries, selct a few lines, close that form, close item tracking, and repeat TWENTY times. We ended up building some different screens to avoid the item tracking windows, but we still used a great deal of their code, it was simply too complex to start from scratch.