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 :
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,300 Super User 2026 Season 1 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,300 Super User 2026 Season 1 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

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans