Loading
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
          Business Object Contract Definition

          Business Object Contract Definition

          Use the elements and attributes of the Business Object contract to model and define a custom object.

          Required Editions

          Available in: Lightning Experience

          Available in: Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled

          Attributes for Business Objects
          Attribute Description Value/Pattern Required
          name Specifies the unique name of the business object. String Yes
          platformObject

          Specifies the object name for which quick actions are to be shown when these conditions are met:

          • A simple property with ID as true is defined.
          • You can define only 5 unique platform objects in a deployment package.
          • Optional. Define recordTypeId of DomId type.
          String No
          generateLoadMethod

          Specifies whether a loadAsync method should be generated for this BO:

          • True: Allows generation of the loadAsync method in the <Methods> element.
          • False: Prevents generation of the loadAsync method in the <Methods> element.
          Boolean. Default is false. No
          generateCreateMethod

          Specifies whether a createAsync method should be generated for this BOs:

          • True: Allows generation of the createAsync method in the <Methods> element.
          • False: Prevents generation of the createAsync method in the <Methods> element.
          Boolean. Default is false. No

          The sub nodes of a business contract are:

          • DataSource: Required. DataSource references the data source that is specified for the BO. Each business object contract has one DataSource node. The name of the datasource is the only attribute of the DataSource node, and is required. The specified datasource name must exist in the model.For example: for the Promotion object with BusinessOject name=”BoPromotion”, <DataSource name="DsBoPromotion" />SimpleProperties - Binds the UI elements.
          • SimpleProperties: Simple properties contain a list of simple properties (1..N) of the BO. See Simple Properties.
          • ObjectLookups: Also known as a lookup object (LU), an object lookup delivers a list of read-only attributes that replace the PKey in the UI. See About Lookup Objects and How They Work.
          • NestedObjects: Contains the nested business objects. Nested objects have a 1:1 relation with other business objects. For example, the BoCall business object has a relation to the BoJobManager business object.
            <NestedObjects>   <NestedObject name="boJobManager" objectClass="BoJobManager" dataSourceProperty="pKey" nestingProperty="clbMainPKey" loadMode="LoadImmediate" /></NestedObjects>
            You can use the nesting alias (name) to get access to the properties and methods of a nested object. For example, in a process:
            <Action name="loadAndSetPrerequisites" actionType="LOGIC" call="ProcessContext::MainBO.boJobManager.loadAndSetPrerequisites">
          • ListObjects: Binds a list to a business object. Contains a list of nested List Objects(0..n) of the business object.
          • Methods: Use to declare all business object methods, including pre, post, and replace methods. Contains the methods (0…n) of the Business Object. Business objects can have both generated and customized methods. For example,
            <Methods>  <Method name="beforeSaveAsync" />  <Method name="afterSaveAsync" />  <Method name="beforeLoadAsync" />  <Method name="afterLoadAsync" /></Methods>
            For information about adding business logic contracts and the types of methods that are added to a business object, see Add Methods or Business Logic Contracts Automatically. 
          • Validations: Specifies the methods (business logic) that are used to validate the Business Object. For example,
            <Validations>  <Validation name="ValidateAsync" /></Validations>

          Sample Business Object contract:

          <BusinessObject name="BoMyNewBusinessObject" xmlns=".xsd" generateLoadMethod="false" generateCreateMethod="false" OERReference="" schemaVersion="1.1">
            <DataSource name="DsBoMyNewBusinessObject" />
            <SimpleProperties>
              <SimpleProperty>
          	<Events>
          	   <Event> </Event>
          	</Events>
              </SimpleProperty>
            </SimpleProperties>
            <ObjectLookups>
          	<ObjectLookup> </ObjectLookup>
            </ObjectLookups>
            <NestedObjects>
          	<NestedObject> </NestedObject>
            </NestedObjects>
            <ListObjects>
          	<ListObject>
          	  <Events>
          		<Event> </Event>
          	  </Events>
          </ListObject>
            </ListObjects>
            <Methods>
          	<Method></Method>
            </Methods>
            <Validations>
          	<Validation></Validation>
            </Validations>
          </BusinessObject>
          
           
          Loading
          Salesforce Help | Article