All inventory is serialized, so Item Tracking Code is SNALL.
Pulling data into an item journal line. Normal stuff like posting date, description, quantity, the usual.
Using the following code to add the reservation entry:
CreateReservEntry.SetDates(
0D, 0D);
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Item Journal Line",
0,
ItemJnlLine."Journal Template Name",
ItemJnlLine."Journal Batch Name",
0,
ItemJnlLine."Line No.",
ItemJnlLine."Qty. per Unit of Measure",
1,
SerialNo,
'');
CreateReservEntry.CreateEntry(
ItemJnlLine."Item No.",
ItemJnlLine."Variant Code",
ItemJnlLine."Location Code",
ItemJnlLine.Description,
ItemJnlLine."Posting Date",
ItemJnlLine."Document Date",
0,
2);
Everything looks ok at this point in table 337 (Reservation Entry) and the item journal lines look great.
Posting Error: You must not specify serial no in item journal line...
If I delete the serial number and try to post I get the error:
"Tracking Specification is Missing"
What am I missing here? Debugger and code coverage were less than helpful.
Comments
Had this before - you can't put the serial number into the journal line table it need to go onto the reservation table - are you specifing the serial no. on the create entry routine?
What I normally do is to manually enter a line and then look at the system generated entry
Hope this helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Manually insert item tracking in journal line. Then compare reservation entries differences between your automated post and manually inserting.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
notice the red.
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Item Journal Line",
ItemJnlLine."Entry Type",
ItemJnlLine."Journal Template Name",
ItemJnlLine."Journal Batch Name",
0,
ItemJnlLine."Line No.",
ItemJnlLine."Qty. per Unit of Measure",
1,
'tada',
'');
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n