How to Use Standard Placeholders
We can use Docentric placeholders in any of print destination settings where it makes sense (Output filename, Azure blob container, Email address, Email body, etc.). There are two kinds of Docentric placeholders: Standard and Custom placeholders.
Standard placeholders are provided out-of-the-box for all reports. Please find the supported list below.
On the other hand, Custom placeholders are report specific and also provided by an additional model with so called Docentric SSRS Replicas, which can also be used with Free Edition. Learn more >>
From the 3.3.8 version on, we introduced a new type of report specific placeholders called User-defined placeholders, which can be configured in Docentric report setup.
Standard placeholders
Standard placeholder list:
- @FIELD_{Name of the field from the Report Execution Context table}@ -> extract the value of the specified field
- @METHOD_{Name of the method from the Report Execution Context table}@ -> extract the value of the specified parameterless method, e.g. a display method
- @PARAMETER_{Name of the report parameter}@ -> extract the value of the specified report parameter
- @REPORTID@
- @REPORTCAPTION@
- @COMPANYID@
- @COMPANYLOGO@
- @COMPANYNAME@
- @USERID@
- @USERNAME@
- @USERALIAS@
- @USEREMAIL@
- @WORKER@
- @WORKERTITLE@
- @WORKERDEPARTMENT@
- @WORKEREMAIL@
- @WORKERIMAGE@
- @LANGUAGEID@
- @TIMESTAMP@
- @CURRENTDATE@
- @CURRENTDATETIME@
- @CURRENTDAY@
- @CURRENTMONTH@
- @CURRENTYEAR@
- @GUID@
- @BATCHJOBID@
- @BATCHJOB_SCHEDULED_STARTDATETIME@
- @BATCHJOB_ACTUAL_STARTDATETIME@
- @ENVNAME@ -> returns the current Environment name defined in Docentric AX parameters > Diagnostics
- @ENVDOMAINNAME@ -> returns the current environment domain name
- @ENVMODE@ -> returns the current Environment mode (e.g., Production, Test, Development) defined in Docentric AX parameters > Diagnostics
- @ENVTYPE@ -> returns the hosting environment type defined in D365FO (e.g., Cloud, ComputeEmulator, OnPremises, ServiceFabric, SyncEngine)
For example, we can put this kind of text in Email Body on the Docentric Email print destination:
*** Prepared by @WORKER@ on @CURRENTDATE@.
The result will be:
*** Prepared by Kevin Cook on 05/25/2015.
Standard image placeholders
Note that @COMPANYLOGO@ and @WORKERIMAGE@ are image placeholders, and you can use them within an email body when emailing reports.
Learn more on how to use Standard image placeholders >>
Report execution context record and Standard placeholders
Report execution context record can also be changed dynamically. Learn how >>
Report execution context record is set automatically usually when report is printed in the context of an underlying record (entity). For example, when Purchase order is printed from the Purchase order confirmation form for the currently selected VendPurchOrderJour record, then this record acts as the report execution context record.
You can also print a report from the code and set the report execution context record programmatically:
Known issue: Report execution context is not set when posting invoices
If you are using standard placeholders such as @FIELD_InvoiceId@ when posting invoices, you will encounter the following issue: Report execution context is not set and the field value (InvoiceId) cannot be calculated.
Explanation: When posting an invoice, the Sales invoice report controller is not called providing the context record as args.record(), so the context record will be empty and consequently, you cannot use standard placeholders. On the other hand, when you print an already posted invoice from Invoice journal, the context record is set properly and everything works as expected.
This can be fixed by extending the report controller, or (much easier way) you can create a custom Docentric’s DSP class where you will set this context record to the current sales order.
Thus, the solution for this issue is to install the Docentric AX SSRS Replicas model and use the custom @InvoiceId@ placeholder instead of the @FIELD_InvoiceId@ standard placeholder.
Using placeholders in Docentric report setup
Note that all types of placeholders (Standard, Custom and User-defined) can also be used in Docentric report setup, e.g. in report caption, PDF encryption passwords, PDF document properties, email sending settings such as email sender display name, reply-to, bounce-to and read receipt email addresses.
Also note that wherever you can use placeholders, you can also use D365FO and Docentric User-defined labels. This way you can make, e.g. report caption or PDF document properties multilingual.
See also
How to Use Custom Placeholders in Print Destinations >>
How to Use User-Defined Placeholders in Print Destinations >>
How to Use Labels in Print Destinations >>