In G/L finance card (report #4) i want to add ‘your reference’ field from sales invoice header / purchase invoice header to the description field.
the report is picking the invoice line description, but i want to append the ‘your reference’ field from the invoice header table to tihs field. how to get this.
Report #4 uses the G//L entry table as its source. The ‘Your reference’ field is not passed to this table during document posting ( unless you have a modification). You may want to be using the ‘External Document No.’ this is a navigatable field that is transferred throughout the system. Otherwise in the report you will have to do a lookup into the appropriate tables to get the reference field.
In the the OnAfterGetRecord of G/L entry, i have the code
IF (“G/L Entry”.“Document Type” = 2) AND (“G/L Entry”.“Source Type” = 1) THEN
BEGIN
rSalesInvEntry.SETRANGE(rSalesInvEntry.“Document No.”,“G/L Entry”.“Document No.”);
IF rSalesInvEntry.FIND(’-’) THEN
vAlternDescription := “G/L Entry”.Description + ’ ’ + rSalesInvEntry.Description
END ELSE
here rsalesinventry is salesinvoiceline record.
what i understand from this code is, its taking description from the sales invoice line table for that particular entry. I just want to get a field ‘your reference’ from the sales invoice header table for the same entry. i have the data in this particular field
If you need data from Sales Invoice Header Table fro Your Refernce then you need to a fine on sales Invoice Header for that document no. and then get the value of Your Reference field the same way as the value for Description field is beign entered from sales Invoice Line here.
For example:
if SalesInvoiceHeader.get(“G/L Entry”.“document no.”) then begin