Using Object Triggers for Business Objects in VBCS

Using Object Triggers for Business Objects in VBCS

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.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Step2: Create Object Trigger on DeptBO business object.

Navigate to DeptBO Business Object —>Business Rules —->Object Triggers.

A screenshot of a computer

AI-generated content may be incorrect.

Click on +New Object Trigger.

Provide valid Object Trigger Name and click on “Create Object Trigger”.

A screenshot of a computer

AI-generated content may be incorrect. This will open designer panel where we can add conditions and actions.

A screenshot of a computer

AI-generated content may be incorrect.

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

A screenshot of a computer

AI-generated content may be incorrect.

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

A screenshot of a computer

AI-generated content may be incorrect.

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.

A screenshot of a computer

AI-generated content may be incorrect.

Select departmentName from LOV and click on Expression.

A screenshot of a computer

AI-generated content may be incorrect.

Select departmentName from DeptBO Business Object and click on OK.

Similarly add field location and respective mapping as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

Click on Done to save the changes.

A screenshot of a computer

AI-generated content may be incorrect.

Step3: Test the result

Let us create a new entry into the DeptBO business object.

A screenshot of a computer

AI-generated content may be incorrect.

Click on +Row.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Add row.

This will create a new record into DeptBO Business Object.

A screenshot of a computer

AI-generated content may be incorrect.

Let us check DeptBONew Business Object.

A screenshot of a computer

AI-generated content may be incorrect.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top