Enter serial no. through code

new_to_cal
Member Posts: 21
Hi folks,
I would like to enter given serial numbers for a purchase order through code. Could anybody tell me, how this is done?
I would like to enter given serial numbers for a purchase order through code. Could anybody tell me, how this is done?
0
Answers
-
Then insert the reservation entry by code with required field detail. You can also search the forum for same.0
-
I believe ara3n posted some code on here that works wonderfully. Search!Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Here is an example
SalesLine.get(SalesLine."Document type"::Order,'1532',20000); SalesHeader.get(SalesHeader."Document type"::Order,'1532'); CreateReservEntry.SetDates( 0D, 0D); CreateReservEntry.CreateReservEntryFor( DATABASE::"Sales Line", SalesLine."Document type", SalesLine."document No.", '', 0, SalesLine."Line No.", SalesLine."Qty. per Unit of Measure", 1, 'YOURSERIALNO', ''); CreateReservEntry.CreateEntry( SalesLine."No.", SalesLine."Variant Code", SalesLine."Location Code", SalesLine.Description, SalesHeader."Posting date", SalesHeader."Document Date", 0, 2);
0 -
CreateReservEntry is cu Create Reserv. Entry0
-
Amongst others I found this post. The Code
CreateReservEntry.SetDates( 0D, 0D); CreateReservEntry.CreateReservEntryFor( DATABASE::"Sales Line", SalesLine."Document Type", SalesLine."Document No.", '', 0, SalesLine."Line No.", SalesLine."Qty. per Unit of Measure", ABS(SalesLine.Quantity), 'RANDOMSNR', ''); CreateReservEntry.CreateEntry( SalesLine."No.", '', SalesLine."Location Code", SalesLine.Description, 0D, SalesLine."Shipment Date", 0, 3);
does create a reservation entry with the correct serial no. but the reservation status is Prospect instead of Reservation. Is that correct?0 -
It should be Surplus. If you manually create a Purchase Order for a Serial Tracked item and manually create the tracking line - you can then go to the Reservation Entry table and see how the reservation entry should be populated.Gerry Kistler
KCP Consultores0 -
gerrykistler wrote:It should be Surplus. If you manually create a Purchase Order for a Serial Tracked item and manually create the tracking line - you can then go to the Reservation Entry table and see how the reservation entry should be populated.
I don't want to be seen near a Purchase Order :P
I was talking about Sales Orders!0 -
new_to_cal wrote:I was talking about Sales Orders!No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
new_to_cal wrote:gerrykistler wrote:It should be Surplus. If you manually create a Purchase Order for a Serial Tracked item and manually create the tracking line - you can then go to the Reservation Entry table and see how the reservation entry should be populated.
I don't want to be seen near a Purchase Order :P
I was talking about Sales Orders!
It is the same for Sales Orders as it is for Purchase Orders - the only difference is the sign on the quantity. Just take my response above and replace Purchase with Sales.Gerry Kistler
KCP Consultores0 -
gerrykistler wrote:It is the same for Sales Orders as it is for Purchase Orders - the only difference is the sign on the quantity. Just take my response above and replace Purchase with Sales.
what about "Source type" and Positive field? both are also differ for sale/purchase.0 -
new_to_cal wrote:Amongst others I found this post. The Code
CreateReservEntry.SetDates( 0D, 0D); CreateReservEntry.CreateReservEntryFor( DATABASE::"Sales Line", SalesLine."Document Type", SalesLine."Document No.", '', 0, SalesLine."Line No.", SalesLine."Qty. per Unit of Measure", ABS(SalesLine.Quantity), 'RANDOMSNR', ''); CreateReservEntry.CreateEntry( SalesLine."No.", '', SalesLine."Location Code", SalesLine.Description, 0D, SalesLine."Shipment Date", 0, 3);
does create a reservation entry with the correct serial no. but the reservation status is Prospect instead of Reservation. Is that correct?
Yes. try and insert through ui manually and then compare the records0 -
Luc Van Dyck wrote:Reread your first posting.
Nevertheless - Thanks @all for the support.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