Skip to main content

Notifications

Announcements

No record found.

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 Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    Thank you very much for your valuable guidance Sir.

  • Rashed Profile Picture
    Rashed 3,765 on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    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?

  • Verified answer
    Rashed Profile Picture
    Rashed 3,765 on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    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
    Community Member Microsoft Employee on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    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).

  • Rashed Profile Picture
    Rashed 3,765 on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    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
    Community Member Microsoft Employee on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???
     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
    Rashed 3,765 on at
    RE: How to create Item Tracking line for Sales Order and Transfer order through CAL Code???

    Here is an example

    forum.mibuso.com/.../259094

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans