How to fetch second and third line from sale invoice
Markandey_Pandey
Member Posts: 178
Hi all,
I want to fetch the description of second line and third line from sales invoice line table on Integer Header and Footer Section.
I have written the following code in OnPreSection of Header but its not working
Line2Data->Text
Line3Data->Text
SalesInvoiceLine.RESET;
SalesInvoiceLine.SETRANGE("Document No.","No.");
//SalesInvoiceLine.FINDFIRST;
IF(SalesInvoiceLine."Line No."=20000) THEN
Line2data:=SalesInvoiceLine.Description;
IF(SalesInvoiceLine."Line No."=30000) THEN
Line3Data:=SalesInvoiceLine.Description;
can anybody tell me the solution
I want to fetch the description of second line and third line from sales invoice line table on Integer Header and Footer Section.
I have written the following code in OnPreSection of Header but its not working
Line2Data->Text
Line3Data->Text
SalesInvoiceLine.RESET;
SalesInvoiceLine.SETRANGE("Document No.","No.");
//SalesInvoiceLine.FINDFIRST;
IF(SalesInvoiceLine."Line No."=20000) THEN
Line2data:=SalesInvoiceLine.Description;
IF(SalesInvoiceLine."Line No."=30000) THEN
Line3Data:=SalesInvoiceLine.Description;
can anybody tell me the solution
Markandey Pandey
0
Comments
-
Hi,
I don't know the reason why you do this, so i don't know is this the best solution, but about the code
You will never know if second line is 20000 and third is 30000 so maybe little correction:SalesInvoiceLine.RESET; SalesInvoiceLine.SETRANGE("Document No.","No."); SalesinvoiceLine.SETRANGE(Type,0); //only if you talk about the description lines If SalesInvoiceLine.FINDSET THEN REPEAT counter+=1; CASE counter of 2: Line2data:=SalesInvoiceLine.Description; 3: Line3data:=SalesInvoiceLine.Description; END; UNTIL (SalesInvoiceLine.NEXT=0) OR (counter=4)0 -
Markandey Pandey wrote:Hi all,
I want to fetch the description of second line and third line from sales invoice line table on Integer Header and Footer Section.
I have written the following code in OnPreSection of Header but its not working
Line2Data->Text
Line3Data->Text
SalesInvoiceLine.RESET;
SalesInvoiceLine.SETRANGE("Document No.","No.");
//SalesInvoiceLine.FINDFIRST;
IF(SalesInvoiceLine."Line No."=20000) THEN
Line2data:=SalesInvoiceLine.Description;
IF(SalesInvoiceLine."Line No."=30000) THEN
Line3Data:=SalesInvoiceLine.Description;
can anybody tell me the solution
What if the sales line has more than 1 item?CA Sandeep Singla
http://ssdynamics.co.in0 -
What if the sales line has more than 1 item?[/quote]
that is what i have written, i want to fetch the second and third line description and its clear that there cannot be more than 3 lines also here second and third line is having only description.
People may ask why i am doing so, actually 2nd and 3rd line description is being used as comment in case the 1st line contains supplementry bill.Markandey Pandey0 -
Thanx
The problem is resolvedMarkandey Pandey0
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