The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
Determines whether a report is currently set up to use a custom Word layout or RDLC layout at run time.
HasCustomLayout(ObjectType : 'Report'; ObjectID : Integer) : Integer
The Dynamics 365 object type that is run. Currently only the Report value is supported.
The ID of the Dynamics 365 report object.
The following values are available.
|0||The report is not currently set up to use a custom RDLC or Word layout.|
|1||The report is currently set up to use a custom RDLC layout.|
|2||The report is currently set up to use a custom Word layout.|
Report layout implementation in codeunit 1 ApplicationManagement.
This method is executed when a report is run from the client or by a call to the Run, SaveAsWord, SaveAsPdf, and SaveAsExcel methods. The HasCustomLayout method is executed at run time before the OnPreReport Trigger.
The following example shows the default implementation on the method in codeunit 1. This example uses a variable ReportLayout that has the data type Record and subtype Report Layout.
IF ObjectType <> ObjectType::Report THEN ERROR(NotSupportedErr); IF ReportLayout.GetActiveReportLayout(ObjectID,ReportLayout.Type::RDLC) THEN EXIT(1); IF ReportLayout.GetActiveReportLayout(ObjectID,ReportLayout.Type::Word) THEN EXIT(2); EXIT(0);