To show PDF reports in the Consumer Goods offline mobile app and to print those reports,
create a PrintLayoutV2 contract in Visual Studio Code-based Modeler .
Required Editions
| Available in: Professional, Enterprise, and Unlimited Editions
that have Consumer Goods Cloud enabled |
| User Permissions Needed |
| To create a PrintLayoutV2 contract: |
CG Cloud Developer AND Admin |
-
Open Visual Studio Code-based Modeler.
-
In your Modeler workspace, create a folder called MyDisplayPDF at the location:
$workspace/src/MyDisplay/PL.
-
To create a PrintLayoutV2 contract, copy this template in a blank XML file:
<PrintLayout name="${#Name#}PDF" xmlns="https://www.salesforce.com/cgcloud/xsds" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Declarations></Declarations>
<ReportLayout></ReportLayout>
</PrintLayout>
-
Save the contract as MyDisplayPDF.printlayoutv2.xml.
-
To check for validation errors, build your contracts by running
sf mdl build.
-
In the Declaration section, create two declarations:
<DataDeclaration name="currentDisplay" type="BoMyDisplay" />
<DataDeclaration name="loDisplays" type="LoMyDisplays" />
-
Save your changes.
-
To check for validation errors, build your contracts by running
sf mdl build.