Hi,
Can you please assist? I am trying add a field to an existing report but when I copy the code from the original report to add the extra field I get an AL0296: The application object or method 'GetPaymentInstructionsFromPostedInvoice' has scope 'OnPrem' and cannot be used for 'Cloud' development error. This specific field comes from the old report.
I have tried to change the app.jason target to "OnPrem" and it works when building the report but fails when uploading to the cloud with error: Package validation failed due to the following error(s): app.json (8,3) - Error PTE0005: The compilation target is set to 'OnPrem', but it must be set to 'Cloud' or 'Extension'
app.json :
I have also tried the reportextension method but I cant seem to link to the correct table when trying to only add this and not redo the whole report.
This is the existing code that fails:
Clear(PaymentInstructionsTxt);
PaymentInstructionsTxt := O365SalesInvoiceMgmt.GetPaymentInstructionsFromPostedInvoice(Header);
And the report extension code:
reportextension 50201 "IPL_SalesInvoice" extends "Standard Sales - Invoice"
{
RDLCLayout = 'src\Business Central\src\reportLayout\IPL Sales Invoice.rdlc';
dataset
{
add(IPL_SalesOrder)
{
column(Sales_Assistant; "Sales Assistant") { }
}
}
}
Also below my table extension for IPL_SalesOrder to add the sales assistant field:
tableextension 60001 IPL_SalesOrder extends "Sales Header"
{
fields
{
field(50000; IPL_SalesAssistant; Text[30])
{
Caption = 'Sales Assistant';
}
}
}
Please advice as I am now stuck
Thanks