Options

How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

kovaidonkovaidon Member Posts: 54
edited 2016-06-20 in NAV Three Tier
I was able to find the how to create Item Tracking lines in Sales Order automatically

I have checked CDU 99000830 and found two Function.
CreateReserveentryfor.
CreateReserveentry.

Here is the code that i have added and reservation entry is getting created for the same.


CreateReservEntry.CreateReservEntryFor(DATABASE::"Sales Line",
LT37."Document Type",
LT37."Document No.",
'',
0,
LT37."Line No.",
LT37."Qty. per Unit of Measure",
ABS(LT37.Quantity),
ABS(LT37."Quantity (Base)"),
InventorybyLocAndSerial."Serial No." ,
InventorybyLocAndSerial."Lot No.");

CreateReservEntry.CreateEntry(
LT37."No.",
'',
LT37."Location Code",
LT37.Description,
0D,
LT37."Shipment Date",
0,
3);

But Am not able to find any line in Item Tracking lines when i check IN Sales Line --->Line--->Item Tracking lines. it is seems to be empty. Please refer the attachment Picture(Item Tracking Line).

But when i check Reservation entry Table(337). I found a record has been created for that particular line with Source ID = Sales order no.


I dint understand why it is not coming in item Tracking line.

Could any one help me , where the actual mistake , i have done.

Looking for your valuable advice

Answers

  • Options
    Alex_ChowAlex_Chow Member Posts: 5,063
    Your best bet is just to write directly into the reservation entry table. Look at what the standard record is when you fill in the serial number, then replicate it when you do your import.
  • Options
    kylehardinkylehardin Member Posts: 257
    This assumes you have the current Sales Line loaded into SalesLine. You'll have to mess with the quantities, UOMs, and the reservation dates.

    Create a codeunit variable to Create Reserv. Entry

    CreateReservEntry.SetDates(0D, 0D);
    CreateReservEntry.CreateReservEntryFor(
    DATABASE::"Sales Line", SalesLine."Document Type",
    SalesLine."Document No.", '', 0, SalesLine."Line No.", SalesLine."Qty. per Unit of Measure",
    ResvQty, ResvQty, SerialNo, LotNo);
    CreateReservEntry.CreateEntry(Item."No.", SalesLine."Variant Code", SalesLine."Location Code",
    Item.Description, ResvDate, ResvDate, 0, 2); // surplus
    Kyle Hardin - ArcherPoint
Sign In or Register to comment.