web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

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

(0) ShareShare
ReportReport
Posted on by

Hi all,

Can you share me how I can create Item Tracking Lines automatically in Sales order with C/AL code? 

one simple example is appreciated.

*This post is locked for comments

I have the same question (0)
  • Rashed Profile Picture
    3,765 on at

    Here is an example

    forum.mibuso.com/.../259094

  • Community Member Profile Picture
    on at
     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
    item-tracking-lines.PNG
  • Rashed Profile Picture
    3,765 on at

    Insert the serial no manually through UI. And then compare the record in reservation  entry table and see which field is not being populated correctly.  

  • Community Member Profile Picture
    on at

    Sir,

    One small clarification,

    Do the reservation status , plays important role as far as item tracking line is concerned.

    Why because ,i have passed reservation status = 3(Prospect).

  • Verified answer
    Rashed Profile Picture
    3,765 on at

    The status needs to be prospect.  Please run the reservation entry and compare the record inserted through code with the one inserted manually and see which field is not populated correctly.

  • Community Member Profile Picture
    on at

    Sir, I have found my mistake.

    i have not passed the parameter variant code in the cdu.

    Thank you very much for your input.

    One more issue.

    is this same Item Tracking line creation done for sales order  is applicable in case of Transfer order?

  • Rashed Profile Picture
    3,765 on at

    Yes it can be used for all document lines and item journal

  • Community Member Profile Picture
    on at

    Thank you very much for your valuable guidance Sir.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans