How to Change Primary Key Column for Business Object in VBCS

How to Change Primary Key Column for Business Object in VBCS

When a business object is created in VBCS, it creates an ID by default as the primary key. But if we want to change the primary key to any other column which contains unique values, we can do that by following the steps below.

Let us create a new Business Object in VBCS with the name “EmpBOData”.

Navigate to VBCS —>Business Objects.

A screenshot of a computer

AI-generated content may be incorrect.

Provide name and display name as EmpBOData.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Create.

A screenshot of a computer

AI-generated content may be incorrect.

Business object is created.

Every business object is VBCS is created with few default fields as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

Id field is created as primary key for this Business object as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

Let us edit the source code and change the key as false.

A screenshot of a computer

AI-generated content may be incorrect.

Create a new field which we want to change as the primary key.

Navigate to business objects —>EmpBOData —–>Field

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Change the Required property for employeeID and id field as shown above.

Now change the key property for employeeID field from source.

A screenshot of a computer program

AI-generated content may be incorrect.

Add row into business object to test the result.

Navigate to EmpBOData —>Data —>Row.

A screenshot of a computer

AI-generated content may be incorrect.

The employeeID field is now showing AUTO_ID and ID columns as editable.

Leave a Reply

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

Back To Top