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

kovaidon
Member Posts: 55
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
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
0
Answers
-
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.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
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); // surplusKyle Hardin - ArcherPoint0
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