Or perhaps there is a quicker way to copy the value of the original Report fields into newly created fields/variables in the extension, and then add these to the Purch Header report dataset…?
Found this system built-in
Record.Copy method in the docs, but not sure where/how to declare it properly; the below code yields an error. Would appreciate some guidance on how to add this in, if it's feasible.
tableextension 50250 PurchHeaderExt extends "Purchase Header"
{
fields
{
field(50250; CopyRequestedReceiptDate; Date)
{
Caption = 'Copy Requested Receipt Date';
}
field(50251; CopyPromisedReceiptDate; Date)
{
Caption = 'Copy Promised Receipt Date';
}
}
}
reportextension 50250 POReportExt extends "Standard Purchase - Order"
{
dataset
{
add("Purchase Header")
{
column(CopyRequestedReceiptDate; CopyRequestedReceiptDate)
{
}
column(CopyPromisedReceiptDate; CopyPromisedReceiptDate)
{
}
}
}
trigger OnPreReport()
begin
CopyRequestedReceiptDate.Copy(FromRecord: RequestedReceiptDate){};
end;
}
"message": "Expected one of the application object keywords (table, tableextension, page, pageextension, pagecustomization, profile, codeunit, report, reportextension, xmlport, query, controladdin, dotnet, enum, enumextension, interface, permissionset, permissionsetextension, entitlement)",
"message": "The name 'CopyRequestedReceiptDate' does not exist in the current context.",
"startLineNumber": 33,