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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Adding a Tracking Spec Line through AL Code?

(0) ShareShare
ReportReport
Posted on by 358

I am trying to add Tracking Spec entry through code;

  rec_trackingspec.init();

                                                      if rec_trackingspec2.FindLast() then
                                                          rec_trackingspec."Entry No." := rec_trackingspec2."Entry No."   1 else
                                                          rec_trackingspec."Entry No." := 1;
                                                     

                                                      rec_trackingspec."Creation Date" := WorkDate();
                                                      rec_trackingspec.Positive := true;
                                                      rec_trackingspec.Validate("Item No.", rec_SalesLine."No.");
                                                      rec_trackingspec.Validate("Lot No.", rec_itemledgerentry."Lot No.");
                                                      rec_trackingspec."Location Code" := 'MAIN';
                                                
                                                      rec_trackingspec.Validate("Quantity (Base)", rec_SalesLine.Quantity);
                                                      rec_trackingspec.Validate("Bin Code", rec_SalesLine."Bin Code");
                                                      rec_trackingspec."Source Ref. No." := rec_SalesLine."Line No.";
                                                
                                                      rec_trackingspec.Insert(true);

Checking through debugger, I see Insert(true) gets executed, however when i go to check if Tracking Spec has the line I intended to insert, it does not show the entry there.

I have the same question (0)
  • NeoMatrix Profile Picture
    256 on at

    you have to write the code for the "Reservation Entry" [337] table. when data is inserted into "Reservation Entry" then it will show on Tracking specification Page

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    Hi,

    If you notice page "Item Tracking Lines", the source table is temporary. The data in the database will reside table 337 i.e., Reservation Entry.  So you must insert your line into the Reservation Entry table which will appear when you open from the application.

    Regards

    Avinash B

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    You need to use Reservation Entry table.

    You can use Codeunit "Create Reserv. Entry" to create it for you.

  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Take a look at this link for reference on how to create reservation entry.

    thatnavguy.wordpress.com/.../

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans