how can get the first record in a table or the last for a set of records.
for example in the purchase line table,i want for every document number,just get the first line.
the code below only gives the first record for all the records in the table.
setcurrentkey(Document Type,Document No.,Line No.);
setrange(document type,document type::order);
setrange(document no,document no);
if "purchase line" .findfirst then begin
GitemNo=purchase line.No.
end
0
Comments
details here:
FINDFIRST: http://msdn.microsoft.com/en-us/library/dd338835.aspx
FINDLAST: http://msdn.microsoft.com/en-us/library/dd338877.aspx
FINDSET: http://msdn.microsoft.com/en-us/library/dd301434.aspx
FIND: http://msdn.microsoft.com/en-us/library/dd301096.aspx
Are you saying the code is working for you but it's not doing it for each new doc number?
what exactly is the issue?
http://www.BiloBeauty.com
http://www.autismspeaks.org
It finds the first line and the report shows the doc no & item no.
Adjust it to show whatever fields you need.
http://www.BiloBeauty.com
http://www.autismspeaks.org