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
          Create UI and Process Contracts

          Create UI and Process Contracts

          Use Visual Studio Code based Mdoeler to add a UI contract for the wizard and define its process flow.

          Required Editions

          Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled
          User Permissions Needed
          To add and configure UI and process contracts in VS Code Modeler Customizer, Developer
          1. To create a UI contract with process flow to the Display module, open the VS Code terminal, run sf mdl add, and enter these details.
            ? Select the resource you want to add. process
            ? Specify a name for the process: CreateNewWizard
            ? Select the module to which process 'CreateNewWizard' should be added. MyDisplay
            ? Select a suitable option for process 'CreateNewWizard'. process with userinterface
            ? Do you really want to create the process 'CreateNewWizard'? Yes
            Successfully created process 'MyDisplay::MyCreateNewWizardProcess'. */Users/src/MyDisplay/PR/MyDisplay_MyCreateNewWizard/MyDisplay_MyCreateNewWizardProcess.processflow.xml
            */Users/src/MyDisplay/PR/MyDisplay_MyCreateNewWizard/MyDisplay_MyCreateNewWizardUI.userinterface.xml
          2. In MyDisplay_MyCreateNewWizardUI.userinterface.xml, configure these details.
            In this sample, the MyCreateNewWizardUI component is a single section dialog page that allows users to add a display. The page header includes a title Add Display and a menu item Create with a plus sign icon. Users can tap the button to create a new display.
            <UIDescription name="MyDisplay::MyCreateNewWizardUI" schemaVersion="0.0.0.5">
              <Page pagePattern="SingleSectionDialogPage" onBackDiscard="true">
                <PageHeader>
                  <Bindings>
                    <Resource target="title" type="Label" id="AddDisplayId" defaultLabel="Add Display" />
                  </Bindings>
                  <MenuItems>
                    <MenuItem directlyVisible="true" itemId="AddMenuId">
                      <Bindings>
                        <Resource target="Text" type="Label" id="createNewDisplayId" defaultLabel="Create" />
                        <Resource target="Icon" type="Image" id="Plus_PB" />
                      </Bindings>
                      <Events>
                        <ButtonPressedEvent event="createNewDisplay" />
                      </Events>
                    </MenuItem>
                  </MenuItems>
                </PageHeader>
          3. Add a section node called masterSection of the SingleAreaSection type of section pattern.
            <Section sectionName="masterSection" sectionPattern="SingleAreaSection">
            <Area areaName="mainArea" areaPattern="GroupedElementsArea">
          4. Add an area element named mainArea and append this code.
            This sample code outlines a structured form layout for capturing and showing information about a display item.
            <Section sectionName="masterSection" sectionPattern="SingleAreaSection">
              <Area areaName="mainArea" areaPattern="GroupedElementsArea">
                <GroupElement name="Info">
                  <Bindings>
                    <Resource target="Title" type="Label" id="DisplayDetailInfoGroup" defaultLabel="Info" />
                  </Bindings>
                  <InputArea name="Name">
                    <Bindings>
                      <Resource target="Label" type="Label" id="DisplayName" defaultLabel="Name" />
                      <Binding target="Value" binding="ProcessContext::Name" bindingMode="TWO_WAY" />
                    </Bindings>
                  </InputArea>
                  <InputAreaMultiLine name="Description" noOfRows="3">
                    <Bindings>
                      <Resource target="Label" type="Label" id="DisplayDescription" defaultLabel="Description" />
                      <Binding target="Value" binding="ProcessContext::Description" bindingMode="TWO_WAY" />
                    </Bindings>
                  </InputAreaMultiLine>
                </GroupElement>
                <GroupElement name="Type">
                  <Bindings>
                    <Resource target="Title" type="Label" id="DisplayDetailTypeGroup" defaultLabel="Type" />
                  </Bindings>
                  <SelectionBox name="Type">
                    <Bindings>
                      <Resource target="Label" type="Label" id="DisplayType" defaultLabel="Display Type"/>
                      <Binding target="DataSource" toggleId="DisplayType" bindingMode="TWO_WAY" />
                      <Binding target="Value" binding="ProcessContext::Type" bindingMode="TWO_WAY" />
                    </Bindings>
                    <Items>
                      <Bindings>
                        <Binding target="ItemValue" type="Text" binding=".id" bindingMode="ONE_WAY"/>
                        <Binding target="ItemText" type="Text" binding=".text" bindingMode="ONE_WAY"/>
                      </Bindings>
                    </Items>
                  </SelectionBox>
                  <CheckBox name="CompetitorDisplay">
                    <Bindings>
                      <Resource target="Label" type="Label" id="CompetitorDisplayCB" defaultLabel="Competitor Display" />
                      <Binding target="checkedValue" binding="ProcessContext::CompetitorDisplay" bindingMode="TWO_WAY" />
                    </Bindings>
                  </CheckBox>
                </GroupElement>
          5. In MyDisplay_MyCreateNewWizardProcess.processflow.xml, add these details:
            Attribute Value
            UIDescriptionName MyDisplay::MyCreateNewWizardUI
            EventName createNewDisplay
            EndActionName EndCreateNewDisplay
          6. Add this snippet to the Declaration node.
            <Declaration name="Name" type="DomText" />
            <Declaration name="Description" type="DomLongDescription" />
            <Declaration name="CompetitorDisplay" type="DomBool" />
            <Declaration name="Type" type="DomDisplayType" />
          7. Add this snippet to ReturnValues.
            <Return name="Name" value="ProcessContext::Name" />
            <Return name="Description" value="ProcessContext::Description" />
            <Return name="CompetitorDisplay" value="ProcessContext::CompetitorDisplay" />
            <Return name="Type" value="ProcessContext::Type" />
            <Return name="buttonPressed" type="Literal" value="create" />
          8. Save your changes.
          9. To check for validation errors, build the contracts by running this command: sf modeler workspace build
           
          Loading
          Salesforce Help | Article