Print Serial number on Sales Invoice document
themave
Member Posts: 1,058
Navision 4.0 non-sp1
we sell a lot of specific cost items on Sales orders, we always sale only one item per sales line,when it is a specific cost item, even though Navision would let you sell multiple items.
We would like to print on the posted sales invoice the serial number just below the part number. there is no direct link to the item tracking code from the sale invoice line table, the sales invoice line table has a link to the shipment line, witch has a link to the item tracking line table.
I can not figure a way to get the serial # into a variable on the sale invoice document so I can print it out.
any ideas ?
This seems like it should be standard functionality, would not everyone need the serial number of items sold to appear on sales documents ?
we sell a lot of specific cost items on Sales orders, we always sale only one item per sales line,when it is a specific cost item, even though Navision would let you sell multiple items.
We would like to print on the posted sales invoice the serial number just below the part number. there is no direct link to the item tracking code from the sale invoice line table, the sales invoice line table has a link to the shipment line, witch has a link to the item tracking line table.
I can not figure a way to get the serial # into a variable on the sale invoice document so I can print it out.
any ideas ?
This seems like it should be standard functionality, would not everyone need the serial number of items sold to appear on sales documents ?
0
Comments
-
If you go to a posted invoice and click on line button and then Item tracking lines and follow the code, it calls several functions and comes to the following function
CallPostedItemTrackingForm3(InvoiceRowID) // Used when calling Item Tracking from invoiced documents: ValueEntryRelation.SETCURRENTKEY("Source RowId"); ValueEntryRelation.SETRANGE("Source RowId",InvoiceRowID); IF ValueEntryRelation.FIND('-') THEN BEGIN SignFactor := TableSignFactor2(InvoiceRowID); REPEAT ValueEntry.GET(ValueEntryRelation."Value Entry No."); ItemLedgEntry.GET(ValueEntry."Item Ledger Entry No."); TempItemLedgEntry := ItemLedgEntry; TempItemLedgEntry.Quantity := ValueEntry."Invoiced Quantity"; IF TempItemLedgEntry.Quantity <> 0 THEN AddTempRecordToSet(TempItemLedgEntry,SignFactor); UNTIL ValueEntryRelation.NEXT = 0; FORM.RUNMODAL(FORM::"Posted Item Tracking Lines",TempItemLedgEntry);
The InvoiceRowID in this case is
"113";"0";"103022";"";"0";"10000"
where
113 is table No.
103022 is invoice no.
10000 is invoice line no.
That is all you need to find value entry from which you then find the item ledger and once you've found the item ledger, you have your serial no.
0 -
Hi all,
I have a requirement where i need to sell an item of quantity 5 having different serial numbers and print all five serial nos along with the item no on the sales document/invoice.
so i have writen the following code to achieve this but its not working,
globals used are:
i->int
SerialNo ->an array of type text having dimension as 10ItemLedgerEntry.SETRANGE("Document No.","Sales Invoice Line"."Document No."); ItemLedgerEntry.SETRANGE("Item No.","Sales Invoice Line"."No."); i:=1; IF ItemLedgerEntry.FIND('-') THEN REPEAT SerialNo[i]:=ItemLedgerEntry."Serial No."; i:=i+1; UNTIL (ItemLedgerEntry.NEXT=0);Actually i want to store all serial nos into the array SerialNo.
Can anybody tell me what wrong i am doing or can suggest me the appropriate solution.0 -
The Item ledger entry will not have same document no as Sales Invoice No. In most cases it will have sales shipment Document No.
You have to find the sales shipment document and then find the item ledger entry. THe other option is to find the value entries related to sales invoiceValueEntry.SETRANGE("Document No.","Sales Invoice Line"."Document No."); ValueEntry.SETRANGE("Item No.","Sales Invoice Line"."No."); i:=1; IF ValueEntry.FIND('-') THEN REPEAT ItemLedgerEntry.get(ValueEntry."Item Ledger Entry No.") SerialNo[i]:=ItemLedgerEntry."Serial No."; i:=i+1; UNTIL (ValueEntry.NEXT=0);0 -
ara3n wrote:The Item ledger entry will not have same document no as Sales Invoice No. In most cases it will have sales shipment Document No.
Thanx for the reply, yes, i noticed this after my post when i saw the records of Item Ledger entry table.
Now, I dont want to print the array contents on the report like this: SerialNo[1],SerialNo[2]....and so on, instead i want to run a loop
is there any alternative to this0 -
You can insert the serial No. into a temporary table and then use an Integer Dataitem to loop the temp table.
Salut!
Laura NicolàsLaura Nicolàs
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

