You are here:
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 |
-
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 -
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> -
Add a section node called
masterSectionof theSingleAreaSectiontype of section pattern.<Section sectionName="masterSection" sectionPattern="SingleAreaSection"> <Area areaName="mainArea" areaPattern="GroupedElementsArea"> -
Add an area element named
mainAreaand 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> -
In MyDisplay_MyCreateNewWizardProcess.processflow.xml, add these
details:
Attribute Value UIDescriptionName MyDisplay::MyCreateNewWizardUIEventName createNewDisplayEndActionName EndCreateNewDisplay -
Add this snippet to the
Declarationnode.<Declaration name="Name" type="DomText" /> <Declaration name="Description" type="DomLongDescription" /> <Declaration name="CompetitorDisplay" type="DomBool" /> <Declaration name="Type" type="DomDisplayType" /> -
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" /> - Save your changes.
-
To check for validation errors, build the contracts by running this command:
sf modeler workspace build
Did this article solve your issue?
Let us know so we can improve!

