auto import serial numbers in tracking specification table


i import items in item journal to do a negative adjustment , the items have serial numbers but i dont want

to take serail number one by one in item tracking lines Form , so i import the serial numbers in tracking specification table

but it doesn’t appear in this form, so when i post the item journal i get the clsassical message “serial number is required”.

i m blocked here

some one have any idear to make the serail numbers appear in the form ; ore some information do i add ?

thanks very much (this problem taks me many days with out result)

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. The following example,is 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 document line, you would just loop this code changing the quantity, lot & serial. It then creates the reservation entry properly.

CreateReservEntry.CreateReservEntryFor(DATABASE::“Purchase Line”,
“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,

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 closed, then the reservation engine loops & 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 unusable, 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, select 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.

Hi Aekmen,

From your description, it sounds like you’re importing data into the Item Journal with Serial Numbers so you can adjust your inventory quantities. It also sounds like you’ve completed the code that imports the data into each table, and that you’re having an issue with not seeing the serial numbers you imported. Consequently when you try to post the journal, it fails because it doesn’t have the necessary serial numbers.

I think this is probably caused by some missing or incorrect data in the Tracking Specification records. Although the primary key for that table is Entry No. (which doesn’t have any relationship to the entries in the Item Journal), there are other fields in the Tracking Specification record that you need to fill with key data from the Item Journal. The easiest way for you to see what you’re missing would be to manually add a line in the Tracking Specification table from the Item Journal. Then compare that record that you manually created through the Item Journal form to the ones you imported. You can do that by running the TS table from Object Designer and filtering the records down to the ones you want to see.

It’s probably the case that you’re missing a value in one of the fields from the second key of the table, which includes:

Source ID,Source Type,Source Subtype,Source Batch Name,Source Prod. Order Line,Source Ref. No.

So, compare your manual entry to the imported entries, find out which fields you need to populate when you’re doing the import, and adjust your import program accordingly.

Hope that helps.

Hi George

Thanks for your ancewer , thats exactly what i have doing , but with out result

So you’re saying that you’ve checked all of the fields in the TrackSpec line and that everything looks right, but you still can’t see them from the Item Journal form?

If that’s the case, maybe you could zoom and copy a line from the Item Journal and another two from the Tracking Specification - one that you entered manually and one that you imported? Just drop those three entries into 3 separate tabs on a spreadsheet and upload it here?

When you zoom a record you should get a list of all of the fields in that record’s definition, along with all of the values assigned to those fields for the current record. When you copy/paste from the zoom form into Excel, you should get a column of field names and a column of values. This is what we’re looking for for the Journal Line that you imported, the TS line you imported, and the TS line you entered manually.

Seeing this data will really help us troubleshoot your problems. If you could send the import data file as well, that would also be pretty helpful.