You are here:
Workflow for Preparing the Base Object for a State Model
Setting up a base object for a State Model requires setting up its fields and record page, then configuring the State Model object definition to recognize the base object and its states field.
You have three choices:
-
Use Asset, Contract, Quote, InsuranceClaim__c, or Application__c.
-
Use another existing object (Spring '20 and later releases)
-
Create a new custom object (Spring '20 and later releases)
Most of the workflow tasks apply to all three choices, but most of the specific steps apply to the example Report_Card__c object, which is a new custom object.
- If necessary, Qualify an Existing Object or Create a Custom Object.
- Configure the State Field.
- The needs of your state model determine your next task:
-
If different State Models use different records of the same base object, Configure the Type Field.
-
If necessary, configure new fields that determine states. For the example, Configure the Grade Field.
-
If field values in related objects determine states, Configure a Lookup Field.
-
For better performance, Define a Field Set.
-
- For an existing object, Add State Model Components to an Existing Record Page. For a new object, Add State Model Components to a New Record Page.
- Add the Base Object and State Field Names to the State Model Object.
After you have prepared the base object, you are ready to proceed to the next task in the parent workflow. See Workflow for Creating a State Model, States, and Transitions.
- Qualify an Existing Object
If you're considering using an existing object that isn't Asset, Contract, Quote, InsuranceClaim__c, or Application__c, make sure that it isn't an abstract object such as Activity or Scorecard. - Create a Custom Object
This task only applies if you need to create a new custom object for a State Model. - Configure the State Field
One of the fields in the base object must have values that match all the State Model's state names. (Additional values are allowed.) Using a text field is required, and using a picklist is recommended. If you are using Asset, Contract, Quote, InsuranceClaim__c, or Application__c, a Status field already exists for this purpose, and you can add values to it if necessary. If the Status field isn't suitable for your State Model or you are using a different object, you can choose a different field or create a new one. - Configure the Type Field
Use a type field if different State Models use different records of the same base object. (The Type Field Name and Type Field Value of the State Model will reference this field, if it applies.) For example, State Models for medical and car insurance might use the same InsuranceClaim__c object. In the Report_Card__c example, both students and teachers can be graded, but the State Model applies only to students. - Configure the Grade Field
This field is specific to the Report_Card__c example. (A real-life example might have a Course field as well, but that isn't needed to show how the State Model works.) The default value is I for Incomplete. - Configure a Lookup Field
Most State Model base objects are related to other objects such as Accounts or Contacts. If you are using Asset, Contract, Quote, InsuranceClaim__c, or Application__c, lookup fields for these related objects, such as AccountId__c or ContactId__c, already exist. If the lookup field you need doesn't exist in your base object, you can create it. - Define a Field Set
This task is optional but recommended. If you don't define a field set, the State Model fetches all the fields in the base object. If the object has many fields, this can impact performance. - Add State Model Components to an Existing Record Page
Vlocity provides special components for State Models that display states and rule results. Including these components in the record page for the base object is recommended. You can add them to an existing record page. - Add State Model Components to a New Record Page
Salesforce provides special components for State Models that display states and rule results. Including these components in the record page for the base object is recommended. You can add them to a new record page. - Add the Base Object and State Field Names to the State Model Object
The State Model object definition must reference the API names of all base objects and their state fields.

