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
0
Comments
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.
Chn
This is the current output being shown: 100203,100202, 100201
Please help.
Thanks
Liizz
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.
Chn
Make sure that your code should not like this
Problem solved. =D>
Thanks for your suggestions
Liizz