Create ItemJnlLine with LotNo and Post via Codeunit
jordi79
Member Posts: 281
Hi,
I am trying to create an ItemJnlLine with ItemTrackingSpecification and Post. All this is done via Codeunit.
What I have coded is below:
Item LOTITEM, is a LotSpecific Tracking Item. I have no idea how to pass Tracking Specification table into ItemJnlPostLine. I know that if I were to insert
"actual" TempTrackingSpecification records, I am able to post. But this of course is not the way to go. I was hoping of somehow to pass TrackingSpec records into ItemJnlPostLine, like how TempJnlLineDim is passed to ItemJnlPostLine Codeunit.
Jordan
I am trying to create an ItemJnlLine with ItemTrackingSpecification and Post. All this is done via Codeunit.
What I have coded is below:
ItemJnlLine.INIT;
ItemJnlLine.VALIDATE("Posting Date", TODAY);
ItemJnlLine.VALIDATE("Document No.", 'QWERTY1111');
ItemJnlLine.VALIDATE(ItemJnlLine."Entry Type", ItemJnlLine."Entry Type"::"Negative Adjmt.");
ItemJnlLine.VALIDATE("Item No.", 'LOTITEM');
ItemJnlLine.VALIDATE("Location Code", 'DEFAULT');
ItemJnlLine.VALIDATE(Quantity, 1);
TempJnlLineDim.RESET;
TempJnlLineDim.DELETEALL;
TempTrackingSpec.RESET;
TempTrackingSpec.DELETEALL;
// not sure how to specify TempTrackingSpec and pass to ItemJnlPostLine codeunit for posting!!!
ItemJnlPostLine.RunWithCheck(ItemJnlLine, TempJnlLineDim);
Item LOTITEM, is a LotSpecific Tracking Item. I have no idea how to pass Tracking Specification table into ItemJnlPostLine. I know that if I were to insert
"actual" TempTrackingSpecification records, I am able to post. But this of course is not the way to go. I was hoping of somehow to pass TrackingSpec records into ItemJnlPostLine, like how TempJnlLineDim is passed to ItemJnlPostLine Codeunit.
Jordan
0
Comments
-
You need to create reservation entry. NAV in CU 22 grabs them and creates tracking lines.
Here is code on how to create the reservation entry.
CreateReservEntry = CU 99000830 Create Reserv. EntryCreateReservEntry.SetDates( 0D, 0D); CreateReservEntry.CreateReservEntryFor( DATABASE::"Item Journal Line", ItemJnlLine."Entry Type", ItemJnlLine."Journal Template Name", ItemJnlLine."Journal Batch Name", 0, ItemJnlLine."Line No.", ItemJnlLine."Qty. per Unit of Measure", 1, SerialNo, ''); CreateReservEntry.CreateEntry( ItemJnlLine."Item No.", ItemJnlLine."Variant Code", ItemJnlLine."Location Code", ItemJnlLine.Description, ItemJnlLine."Posting Date", ItemJnlLine."Document Date", 0, 2);
0 -
Hi,
Thanks. It is working now.
Jordan0 -
You are welcome.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
- 322 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
