I seem to be missing a table referance somewhere.
I have a report with 2 dataItems salesInvoiceHeader salesInvoiceLine
the Header got x lines bound to it. On the data items I make a file that with the data from the tables.
salesInvoiceHeader salesInvoiceHeader
salesInvoiceLine salesInvoiceLine
salesInvoiceHeader - OnPreDataItem()
SETRANGE("Nummer",InvoiceNum);
salesInvoiceHeader - OnAfterGetRecord()
...f.WRITE(record)...
salesInvoiceLine - OnPreDataItem()
SETRANGE("Bilagsnr.",InvoiceNum);
salesInvoiceLine - OnAfterGetRecord()
REPEAT
...f.WRITE(record)
UNTIL NEXT = 0;
This all works as intended (included it incase it was there I missed something)
I created a Body for the salesInvoiceHeader
with some Labels and TextFields and put the Sourcescr= salesInvoiceHeader.fields
(this is shown as I want with the data from the SalesInvoiceHeader)
Now the problemI created a salesInvoiceLine Header with some labels in a line, and under that I created a body with a matching line containing textFields where I set the Sourcescr = salesInvoiceLine.field.
But I dont seem to have a referance to the salesInvoiceLine in my body
what am I missing to get the referance to the lines? into the SalesInvoiceLine body?
Answers
RIS Plus, LLC
Thanks DenStar.
btw, REPEAT/UNTIL when would that be used, only if its a variable (tabel) your iterating through?
You need it when you are not in the report and you are not using the OnAfterGetRecord trigger. Because this loop is done automatically by the report...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You'd use REPEAT UNTIL for loops that you want to execute at least once, until the condition evaluates to TRUE
For loops that you only want to run if a certain condition is TRUE (0 times or more) you'd use WHILE
You don't need to use either one in a report, at least not for tables that you have a dataitem for, because the report will do the looping for you.
Check the C/SIDE reference guide, under the help menu for more information about syntax, and a document called w1w1adg.pdf in the Doc folder on your product disc for more detailed application designer information.
RIS Plus, LLC