Field Service inspections support an out of the box export to PDF function. With DocumentsCorePack (DCP) you can easily replicate such a report and integrate it in One-Click-Actions, and can overcome certain limitations of the current export capabilities. This article covers how to create an inspection report for a Work Order Service Task in a DCP template. If you want to build your template based on the table “Work Order”, have a look at this post.
The following step is necessary for obtaining required data, as the questions and answers do not follow the standard table-row-model (entity-record-model) of MS Dataverse. The actual data is stored in fields as blocks of JSON data and these two elements are only loosely bound.
Insert field as Inspection
To insert the inspection response, you must select the field “ResponseJsonContent” [sic] ❶. Then expand the Insert Fields drop down ❷ and select “Insert ‘ResponseJsonContent’ as Inspection” ❸.
If you see a dialog like the one below, you most likely selected a wrong field that is not suitable for an inspection field. As the inspection field is a special case that also requires specific fields from the system, we automatically try to fill this dialog for you. If we find all the correct fields, we fill it automatically and you will not see this dialog.
Afterwards several content controls will appear in your document. The wrapping content control represents the whole inspection. The table row represents a question with an answer. The <<index>> field is the number of the question and the <<title>> field contains the question itself. The <<value>> field contains the answers.
For the normal text formatting, you can simply format the fields with the standard word formatting options, the same way as for DCP Fields. For more details about the additional formatting options, have a look at this article about Inspection response formatting and advanced settings.
Next you can test your template. Each question has its own row with corresponding data.
That’s all on how to create inspection reports for Work Order Service Tasks. We appreciate your feedback! Please share your thoughts by sending us an email to support@mscrm-addons.com!
Downloads
Related Articles
How do I create relationships using DocumentsCorePack Template Designer