Nos. not showing well on report
                
                    liizz                
                
                    Member Posts: 125                
            
                        
            
                    Hi all,
I want to do a search all Nos. on the Sales Shipment Header table based on the Order No. from the Sales Invoice Header.
When for a particular Order No. on the Sales Shipment Header, there is more than one No.. It is displaying only the last line(i.e 102003).
For e.g: Order No=101001; No: 102001, 102002, 102003
This is my codes:
SalesShptHeader.RESET;
SalesShptHeader.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
IF SalesShptHeader.FINDSET THEN BEGIN
REPEAT
SalesShptNo:=SalesShptHeader."No.";
UNTIL SalesShptHeader.NEXT=0;
END;
Thanks
Liizz
                I want to do a search all Nos. on the Sales Shipment Header table based on the Order No. from the Sales Invoice Header.
When for a particular Order No. on the Sales Shipment Header, there is more than one No.. It is displaying only the last line(i.e 102003).
For e.g: Order No=101001; No: 102001, 102002, 102003
This is my codes:
SalesShptHeader.RESET;
SalesShptHeader.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
IF SalesShptHeader.FINDSET THEN BEGIN
REPEAT
SalesShptNo:=SalesShptHeader."No.";
UNTIL SalesShptHeader.NEXT=0;
END;
Thanks
Liizz
0                
            Comments
- 
            Where have you written this code?
If you want to print multiple Nos., either take a dataitem (which will retrieve multiple records from the related table) and put a body section in the report for that dataitem or take a text variable (of big enough length) and concatenate the Nos. which you get looping through the records of the related table.
Chn0 - 
            I have instead concatenate the field No. but the nos. are displayed in a descending order now.
This is the current output being shown: 100203,100202, 100201
Please help.
Thanks
Liizz0 - 
            1.
If header table then,
SETCURRENTKEY("No.")
Or
If line table then,
SETCURRENTKEY("Document No.",...) or whichever key starts with Document No., or create a new key with Document No.
2. Concatenate like DocumentNo (Variable) := DocumentNo + ',' + <RecordVariable>."No." or <RecordVariable>."Document No."
It should fetch the records in correct order.
Chn0 - 
            liizz wrote:This is my codes:
SalesShptHeader.RESET;
SalesShptHeader.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
IF SalesShptHeader.FINDSET THEN BEGIN
REPEAT
SalesShptNo:=SalesShptHeader."No.";
UNTIL SalesShptHeader.NEXT=0;
END;
Liizz
Make sure that your code should not like thisSalesShptNo:=SalesShptHeader."No."+SalesShptNo;
0 - 
            Hello all,
Problem solved. =D>
Thanks for your suggestions
Liizz0 
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
 - 323 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