Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead 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
          Open Display Record Detail From Cockpit Card

          Open Display Record Detail From Cockpit Card

          Sales reps can tap a display record on the cockpit card and launch the display detail page directly on a master detail screen. For example, when you tap the Summer Sale Dump Bin display on the Display cockpit card, the app opens the matching record in the master list and shows its details.

          Required Editions

          Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled
          User Permissions Needed
          To add and configure a master-detail page Customizer, Developer
          1. In your VS Code Modeler workspace, add an ItemSelectedEvent event for the cockpit card in Application_CockpitUI.userinterface.xml by using these details.
            event CardDisplay_itemSelected
            Param name pKey
            Param value .pKey
            The ItemSelectedEvent event configuration in Application_CockpitUI.userinterface.xml looks this:
            <Binding target="Icon" type="Image" binding=".iconId" bindingMode="ONE_WAY" />
                </Bindings>
                </Items>
                <Events>
                   <ItemSelectedEvent event="CardDisplay_itemSelected">
                       <Params>
                           <Param name="pKey" value=".pKey" />
                       </Params>
                   </ItemSelectedEvent>
               </Events>
            </CockpitList>
            <LinkBar>
                <ImageButton name="ShowAllDisplaysButton">
          2. Register the ItemSelectedEvent in the VIEW action in the Application_CockpitProcess.processflow.xml process contract.
            <!-- Card: Display -->
            <Event name="CardDisplay_loadData" action="CardDisplay_loadData" />
            <Event name="CardDisplay_showAllDisplays" action="CardDisplay_loadDisplayDetails" />
            <Event name="CardDisplay_itemSelected" action="CardDisplay_showSelectedDisplayDetails" /›
            <! -- Card: Activities -->
          3. To invoke the detail page, add the CardDisplay_showSelectedDisplayDetails action through the ItemSelectedEvent. Hand over a string called Mode, which a type of decision flag in the detail process.
            This action calls the new display detail process and hands over the pKey of the selected item (through the item selected event). This is needed to select the item in the master list.
            name CardDisplay_ShowSelectedDisplayDetails
            actionType PROCESS
            process MyDisplay::DisplayDetailsProcess
            Param input name and value

            DisplayPKey

            and

            Event.pKey

            Param input name, value, and type

            Mode

            ,

            Cockpit

            , and

            Literal

            The action configuration looks like this:
            <Action name="CardDisplay_showSelectedDisplayDetails" actionType="PROCESS" process="MyDisplay::DisplayDetailsProcess">
                <Parameters>
                   <Input name="DisplayPKey" value="Event.pKey" />
                   <Input name="Mode" type="Literal" value="Cockpit" />
                </Parameters>
            </Action>
            <!-- Card: Display  END-->
          4. To invoke the new master detail page through the item selected event, configure the new display detail process in the MyDisplay_DisplayDetailsProcess.processflow.xml process contract by using these instructions.
            1. To enable selection of an item from the master list, define the input parameters transferred from the cockpit process in the MyDisplay::DisplayDetailsProcess.processflow.xml by using these details.
              The
              <Declarations>
                 <Declaration name="DisplayList" type="LoMyDisplays" />
                 <Declaration name="CurrentDisplay" type="BoMyDisplay" />
              </Declarations>
            2. In the Input parameter, enter Mode as the decision flag in the detail process.
              <Parameters>
                  <Input name="DisplayPKey" type="DomPKey" />
                  <Input name="Mode" type="String" />
              </Parameters>

              The configuration of Declaration and Parameter nodes looks like this:

              <ProcessContext>
                 <Declarations>
                      <Declaration name="DisplayList" type="LoMyDisplays" />
                      <Declaration name="CurrentDisplay" type="BoMyDisplay" />
                 </Declarations>
                 <Parameters>
                       <Input name="DisplayPKey" type="DomPKey" />
                       <Input name="Mode" type="String" />
                 </Parameters>
              </ProcessContext>
            3. To change the flow, add the default action called SelectItemFromCockpit_Decision.
              <Process name="MyDisplay::DisplayDetailsProcess"  defaultAction="SelectItemFromCockpit_Decision" schemaVersion="0.0.0.5">
            4. To ensure that the item detail page is launched from the Display cockpit card, define the decision action of DECISION action type.
              The system checks the input param Mode. If the mode is not Cockpit, the framework calls the VIEW action. If the mode is Cockpit, the framework calls the new action SelectItemFromCockpit.
              name SelectItemFromCockpit_Decision
              actionType DECISION
              parameter ProcessContext::Mode
              Case value and action Cockpit

              SelectItemFromCockpit

              CaseElse action ShowDisplayDetails
              The configuration of decision action looks like this:
              <!-- Check whether the process is called directly from cockpit-->
              <Action name="SelectItemFromCockpit_Decision" actionType="DECISION" parameter="ProcessContext::Mode">
                   <Case value="Cockpit" action="SelectItemFromCockpit" />
                   <CaseElse action="ShowDisplayDetails" />
              </Action>
          5. To set the current item of the list to the display primary key (pKey) as input parameter, define a new action.
            name SelectItemFromCockpit
            actionType LOGIC
            call ProcessContext::DisplayList.setCurrentByPKey
            Parameters Input name and value pkey

            ProcessContext::DisplayPKey

            Parameters Input name, value, and type selected,

            true

            , and

            Literal

            The master detail handler loads the appropriate detail business object based on the pKey.
            <!-- If directly called from cockpit set the current item of the master list to the given pkey (selected in cockpit card)-->
            <Action name="SelectItemFromCockpit" actionType="LOGIC" call="ProcessContext::DisplayList.setCurrentByPKey">
                <Parameters>
                   <Input name="pKey" value="ProcessContext: :DisplayPKey" />
                   <Input name="selected" type="Literal" value="true" />
                </Parameters>
                <TransitionTo action="ShowDisplayDetails" />
            </Action>
            <!-- View Action -->
            <Action name="ShowDisplayDetails" actionType="VIEW">
          6. Save your changes.
          7. To test the changes, build the contracts by running this command. sf modeler workspace build
          8. Refresh the simulator app.
          9. On the Displays cockpit card, click the Summer Sale Dump Bin item. The details page of Summer Sale Dump Bin opens on the master detail page.

          Shows the list of displays records on the Display cockpit card. Shows the master-detail page of the record selected by the user.

           
          Loading
          Salesforce Help | Article