Weird. Adding Records to Reservation Entry
slmaluwa
Member Posts: 366
First of all, it looks weird for me. But, again, dunno whether I do the correct thing.
Based the records of ILE, I wanted to fill a transfer order line (items are lot-tracked). In a loop for selected ILE records, I add the item details and quantity to Transfer Line table. Create the corresponding lines in Reservation Entry table. (Refer code snippet below).
But, once the process completed, I see reservation entries ONLY for the last item in the Transfer Line of that order. Transfer Lines are created for all selected items perfectly. I did DEBUG and saw code executed all reservation entries for all items. But, the records are simply not written to the reservation table.
I want to know whether this is actually possible? If yes, is the way I have done it correct?
Based the records of ILE, I wanted to fill a transfer order line (items are lot-tracked). In a loop for selected ILE records, I add the item details and quantity to Transfer Line table. Create the corresponding lines in Reservation Entry table. (Refer code snippet below).
But, once the process completed, I see reservation entries ONLY for the last item in the Transfer Line of that order. Transfer Lines are created for all selected items perfectly. I did DEBUG and saw code executed all reservation entries for all items. But, the records are simply not written to the reservation table.
I want to know whether this is actually possible? If yes, is the way I have done it correct?
no := LastResNo+1;
//Create Transfer Line.
TransferLine.RESET;
TransferLine.INIT;
TransferLine."Document No." := TransferOrderNo;
IF LineNo = 0 THEN BEGIN
LineNo := 10000;
TransferLine."Line No." := LineNo;
END;
TransferLine.VALIDATE("Item No.",Rec."Item No.");
TransferLine.Quantity := "Remaining Quantity";
TransferLine.VALIDATE(Quantity);
TransferLine.INSERT(TRUE);
//Create the From Entry
rvResEntry.RESET;
rvResEntry.INIT;
rvResEntry."Entry No." := no;
rvResEntry."Item No." := "Item No.";
rvResEntry."Reservation Status" := rvResEntry."Reservation Status"::Surplus;
rvResEntry."Source Type" := DATABASE::"Transfer Line";
rvResEntry."Source ID" := TransferOrderNo;
rvResEntry."Source Subtype" := 0; //Negative 0, Positive 1
rvResEntry."Source Ref. No." := LineNo;
rvResEntry."Location Code" := TransferHeader."Transfer-from Code";
rvResEntry."Qty. per Unit of Measure" := 1;
rvResEntry.VALIDATE("Quantity (Base)", -"Remaining Quantity");
rvResEntry."Shipment Date" := TransferHeader."Shipment Date";
rvResEntry.Positive := FALSE;
rvResEntry."Creation Date" := WORKDATE;
rvResEntry."Lot No." := "Lot No.";
rvResEntry."Item Tracking" := rvResEntry."Item Tracking"::"Lot No.";
rvResEntry.INSERT;
//Create the Receipt Entry
no := no + 1;
rvResEntry.RESET;
rvResEntry.INIT;
rvResEntry."Entry No." := no;
rvResEntry."Item No." := "Item No.";
rvResEntry."Reservation Status" := rvResEntry."Reservation Status"::Surplus;
rvResEntry."Source Type" := DATABASE::"Transfer Line";
rvResEntry."Source ID" := TransferOrderNo;
rvResEntry."Source Subtype" := 1; //Negative 0, Positive 1
rvResEntry."Source Ref. No." := LineNo;
rvResEntry."Location Code" := TransferHeader."Transfer-to Code";
rvResEntry."Qty. per Unit of Measure" := 1;
rvResEntry.VALIDATE("Quantity (Base)", "Remaining Quantity");
rvResEntry."Expected Receipt Date" := TransferHeader."Receipt Date";
rvResEntry.Positive := TRUE;
rvResEntry."Creation Date" := WORKDATE;
rvResEntry."Lot No." := "Lot No.";
rvResEntry."Item Tracking" := rvResEntry."Item Tracking"::"Lot No.";
rvResEntry.INSERT;
no := no + 1;
UNTIL NEXT = 0;
"A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
0
Comments
-
Or else,
can some one help me to create reservation entry for each TransferLine of a particular transfer order? I mean, is there any better or correct way using some codeunits?"A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 324 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