Adding a Tracking Spec Line through AL Code?

mysamza
Member Posts: 66
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.
0
Answers
-
I am trying to add Tracking Spec entry through code above0
-
What do you want to achieve/what is your goal?0
-
@Resolus I want to eventually go search for the Item line from Sales Order and see in Item Ledger Entries if the Item qty on Sales Order is less than the remaining amount from ILE then I want to pick the LOT NO. in from ILE and drop the line in Tracking Specification of that Item in Sales Order. Basically automate Lot No. allocation of all Sales Order lines verifying remaining qty from ILE. For now, I am just trying to write code to insert, which isn't working as mentioned above.0
-
Hello! for Item Tracking you need create entry in Reservation Entry Table.
Exampe for Sales Order:
https://forum.mibuso.com/discussion/comment/332040#Comment_332040
0 -
2. PurchReservEntry.InitTrackingSpecification(PurchLIne, NewTrackingSpecification); This line init NewTrackingSpecification for Purch Line @AlexeyShamin here my first parameter would be sales line, however, where do I have to bring NewTrackingSpecification from?0
-
Sorry Example for Purch Order.
For Sales Order use codeunit Sales Line-Reserve (99000834) instead of Purch. Line-Reserve (99000834) (PurchReservEntry)0
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