Loading
Salesforce now sends email only from verified domains. Read More
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
          Create a Cockpit Card to Show the Competitor Rate Chart

          Create a Cockpit Card to Show the Competitor Rate Chart

          The Competitor Rate chart on the Your Day screen of the CG offline mobile app shows the percentage of competitor products from the displayed products in a store. In the Modeler workspace, integrate the UIPluginV2 contract into the cockpit card to show the Competitor Rate chart.

          Required Editions

          Available in: Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled
          User Permissions Needed
          To create a cockpit card to show the competitor rate chart: CG Cloud Developer, Admin
          1. In your Modeler workspace, add a CardContainer control called CardDisplayReport to the Card Area in the Application_CockpitUI.userinterface.xml contract.
            <!-- Reporting Card START -->
            <CardContainer name="CardDisplayReport">
              <Bindings>
                <Resource target="Title" type="Label" id="ReportingDislpayCardTitle" defaultLabel="Displays" />
                <Resource target="Information" type="Label" id="ReportingDisplayCardInformation" defaultLabel="Competitor Rate" />
                <Binding target="IsReadyToLoad" type="Text" binding="ProcessContext::CardDisplayReport_DataLoaded" bindingMode="ONE_WAY" />
              </Bindings>
              <VisibilityRoles allRoles="true" />
              <Events>
                <LoadContainerData event="CardDisplayReport_loadData" />
              </Events>
              <UIPluginV2 name="MyCardDisplayReportUiPluginV2" uiPlugin="MyCardDisplayReportUiPluginV2">
                <Bindings>
                  <Binding target="competitorRate" type="Text" binding="ProcessContext::CardDisplayReport_CompetitorRate" bindingMode="ONE_WAY" />
                </Bindings>
              </UIPluginV2>
            </CardContainer>
            <!-- Reporting Card END -->
            
          2. Define the declarations for Competitor Rate Cockpit Card in the Application_CockpitProcess.processflow.xml contract.
            <!-- Card DisplayReport -->
            <Declaration name="CardDisplayReport_DisplayList" type="LoMyDisplays"/>
            <Declaration name="CardDisplayReport_DataLoaded" type="DomBool"/>
            <Declaration name="CardDisplayReport_CompetitorRate" type="DomDecimal" />
            
          3. To load data to the report, configure Event handler in the ShowCockpit action section of the Application_CockpitProcess.processflow.xml contract.
            <!-- Card: DisplayReport -->
            <Event name="CardDisplayReport_loadData" action="CardDisplayReport_loadData" />
            
          4. To load the list object and calculate the competitor rate, define the required actions in the Application_CockpitProcess.processflow.xml contract.
            <!-- Card: Display Reports START-->
            <Action name="CardDisplayReport_loadData" actionType="LOAD" type="LoMyDisplays" >
              <Return name="ProcessContext::CardDisplayReport_DisplayList" />
              <TransitionTo action="CardDisplayReport_getCompetitorRate"/>
            </Action>
            <Action name="CardDisplayReport_getCompetitorRate" actionType="LOGIC" call="ProcessContext::CardDisplayReport_DisplayList.myGetCompetitorRate">
              <Parameters/>
              <Return name="ProcessContext::CardDisplayReport_CompetitorRate" />
              <TransitionTo action="CardDisplayReport_setDataLoaded"/>
            </Action>
            <Action name="CardDisplayReport_setDataLoaded" actionType="LOGIC" call="Utils.identity">
              <Parameters>
                <Input name="value" value="1" type="Literal" />
              </Parameters>
              <Return name="ProcessContext::CardDisplayReport_DataLoaded" />
            </Action>
            <!-- Card: Display Reports END→
            
          5. Save your changes.
           
          Loading
          Salesforce Help | Article