You are here:
Creation of Custom Modules and Contracts
Create a custom module, or add an object, method, or user interface to an existing module for your project.
Required Editions
| Available in: Enterprise, Performance, and Unlimited Editions that have Consumer Goods Cloud enabled |
Create these resources by using the sf modeler workspace
add command. A resource refers to the key Modeler objects — module,
contract, or method.
- Module
- Business Object
- List Object
- Lookup Object
- Datasource
- Business Logic
- Method
- Async
- Validation
- User Interface
- Process
- Process
- Process with user interface
The sf modeler workspace add command is a designed as
a wizard - it contains interactive questions which require user input and provides the
option to select objects or modules using arrow keys. Use the instructions in the command to
create the resources required for your project. After the resources are set up in your
module, you’re ready to start modeling the objects and methods for customization.
When you create a module by using the command, these sub folders are automatically created as containers to store the contracts required for the module:
- BO - Business object
- DS - Datasource
- PL - PrintLayout
- PR - Processes and UI
- TB - TempTable
Consider these points when you add resources using the sf
modeler workspace add command:
- When you add a business object, list object or lookup object, the corresponding method files are created automatically.
- When you add custom resources, the system applies the ‘My’ naming convention
automatically to the files. For example,
MyBoDisplay. During the resource creation flow, do not enter ‘My’ in the name value. - You can create only one resource at a time. For example, to add an object and a process to a module, first create the object by using the command. Then, run the command again and add a process contract for the new object. Alternatively, you can manually copy the desired resource template files from $workspace/contractSnippets to the sub folders in the module and configure the contracts. After a resource is added, the system lists all the new and modified files associated with that resource in the terminal or console. Use the multi-selection option in VS Code to open and view the new resource files.
- When you create a module using the command, these sub folders are automatically created
as containers to store the contracts for the module:
- BO - Business object
- Lo - List object
- Lu - Lookup object
- DS - Datasource
- PL - PrintLayout
- PR - Processes and UI
- TB - TempTable
- BO - Business object
- To add a userinterface contract to a module, ensure a process contract exists in the
module. This process contract is used to add a
Viewaction referring to the new userinterface contract.
After running the sf modeler workspace add command, if
your current Modeler workspace is out of date, a log message with the current and expected
versions of the workspace may appear. To upgrade your workspace to the latest version of the
Modeler CLI plugin, run sf modeler workspace
upgrade.

