In this section, we will see how to use object triggers for business objects in VBCS with examples.
Like we have Database triggers on database tables, we have object triggers on business objects in VBCS.
Object triggers is a script which is executed in response to a specific business object event.
Let us consider example-
We have two business objects DeptBO and DeptBONew. When a record is created in the DeptBO business object, the same record should be created in the DeptBONew business object automatically.
Follow below steps to achieve this requirement.
Step1: Create two Business Objects with name DeptBO and DeptBONew with fields:
1.departmentName
2.location
WHO columns are created automatically in VBCS business objects.


Step2: Create Object Trigger on DeptBO business object.
Navigate to DeptBO Business Object —>Business Rules —->Object Triggers.

Click on +New Object Trigger.
Provide valid Object Trigger Name and click on “Create Object Trigger”.
This will open designer panel where we can add conditions and actions.

Select “Always Execute” here as we want to execute this action every time a record gets inserted into the DeptBO Business object.

Click on “Add Actions” to add action from the action group.

Drag and drop “Create Record” from the business object and select the Business Object as “DeptBONew” from LOV.
Click on “Add Field Value” to configure field values for new entries in DeptBONew Business Object.

Select departmentName from LOV and click on Expression.

Select departmentName from DeptBO Business Object and click on OK.
Similarly add field location and respective mapping as shown below:

Click on Done to save the changes.

Step3: Test the result
Let us create a new entry into the DeptBO business object.

Click on +Row.

Click on Add row.
This will create a new record into DeptBO Business Object.

Let us check DeptBONew Business Object.
