Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Usecase: Modify an Order Report and Generate PDF Preview

          Usecase: Modify an Order Report and Generate PDF Preview

          Modify the alignment settings in the order report to center align the cell data under the Qty, Unit Price, amount, and Total columns, and verify the changes in the PDF preview.

          Required Editions

          Available in Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled.
          User Permissions Needed
          To create a generate preview Customizer, Admin
          Print preview
          1. At the command prompt or on a Terminal window, change the directory to the folder in your workspace which contains the printlayoutv2 contract for the report that you want to modify.
            For example: src/Order/PL/DirectCreditOrderPDF.
          2. Open the DirectCreditOrderPDF.printlayoutv2.xml file in Visual Studio Code and set the cell data alignment to center, as shown in this code sample:
            
                  <tbody>
                    <each name="itemsEach" value="{{Declarations::order.loPrintItems}}">
                      <filters>
                        <filter fieldName="quantity" value="0" operator="GT" compareMode="NUMBER" />
                        <filter fieldName="movementDirection" value="In" operator="NE" />
                      </filters>
                      <orderCriteria>
                        <orderCriterion fieldName="prdId" direction="ASC" compareMode="NUMBER" />
                      </orderCriteria>
                      <tr>
                        <td>{{.prdId}}</td>
                        <td>{{.text1}}</td>
                        <td alignment="center">{{.quantityLogisticUnit; toggleId=DomPrdLogisticUnit; toggleField=shortText}}</td>
                        <td alignment="center">{{.quantity}}</td>
                        <td alignment="center">{{.basePriceReceipt; numberFormat=8.2}}</td>
                        <td alignment="center">{{.grossValueReceipt; numberFormat=8.2}}</td>
                        <td alignment="center">{{.valueReceipt; numberFormat=8.2}}</td>
                        <td alignment="center">{{.taxClassification; toggleId=DomTaxClassification; toggleField=shortText}}</td>
                      </tr>
                      <correlation name="correlation1" value="{{Declarations::order.loSdoConditions}}" key="pKey" correlationKey="sdoItemPKey">
                        <filters>
                          <filter fieldName="sdoItemPKey" value=" " operator="NE" />
                          <filter fieldName="cpIsPrintRelevant" value="1" operator="EQ" />
                        </filters>
                        <tr>
                          <td />
                          <td italics="true" colSpan="7">{{path=.text1}}    {{.conditionValue; numberFormat=8.2}}    {{.conditionResult; numberFormat=8.2}}</td>
                        </tr>
                      </correlation>
                    </each>
                    <tr>
                      <td colSpan="3" alignment="center">{{Labels::TotalId; defaultLabel=Total}}</td>
                      <td alignment="center">
                        <sum table="OrderItemsTable" col="3" />
                      </td>
                      <td colSpan="2" />
                      <td alignment="center">
                        <sum table="OrderItemsTable" col="6" numberFormat="8.2" />
                      </td>
                      <td />
                    </tr>
                  </tbody>
          3. Start the server. Run: sf modeler workspace server start.
          4. Open the URL http://localhost:3000/framework/index.html?desktop in a Google Chrome browser to view the simulator app.
          5. In the simulated app, go to Order | Order Overview, and open an order.
          6. To open the menu, click Menu icon, and then click Header icon.
          7. Click Preview.
            The PDF preview of the Order Confirmation report appears.
            PDF
           
          Loading
          Salesforce Help | Article