---
title: Business Object
slug: builder-en/business-object
description: Learn how to create a powerful Business Object with this step-by-step guide. From configuring the database connection to customizing forms, grids, and relationships, this document covers everything you need to know. Execute DDL statements to seamlessly re
createdAt: 2021-10-04T18:10:22.000Z
---

Business Objects are **Builder&#x20;**&#x61;bstractions to **application Data Entities**. Each Business Object represents the data model, which is linked to a table in a relational database and may have one or more Forms associated with it.

## Before getting started

- [x] In order to create a Business Object, you must have configured the **Database Connection** and the **Builder Application**.

## General Data

1. Access the Business Object configuration through the menu `Builder > Management > Business Object`;
2. Click on the "**New**" button;
3. Fill in the fields on the "**Identification**" tab.&#x20;
4. Select the **Application** for which the Business Object is being created, giving it a Name and a Description, and informing the purpose of the Business Object.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/4Q6az9YvHlI6yg8uj3nZ3_image.png "Figure 1 - Identification")

## Database Information

The "**Database**" tab contains the reference to the application database structures. Since each Business Object represents a database table, the information in this tab defines table columns,  relationships among tables, business rules, and SQL commands (if necessary).

1. Fill in the information with:
   - Database Connection to be used for the Business Object;
   - Database Scheme name;
   - Type of database element, being Table or View;
   - Name of the table/view to which the business object is linked.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/G47l_lSvvjI36RLejOWSJ_image.png "Figure 2 - Database")

## Columns

1. Add business object/table columns, informing for each of them:

- **Column name in DB**;
- **Type** of the column (the system will automatically correlate to the corresponding type in the database;);
- **Object attribute name** (it defaults to the column name in the table);
- **Label** for the column to be shown in forms and grids;
- If the column is part of the **Primary Key** for the table;
- If the column is **Required** (mandatory).
- Click on the "Save” button.

:::hint{type="info"}
🖊<u>**Note**</u>**:&#x20;**&#x41;fter saving you will be able to inform Domain key and assign Relationships if it is needed.
:::

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/2FtMQRkvqgqhOB2XpoWSS_image.png "Figure 3 - Columns List")

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/hcIWf6Jm5vCVgF5yQMbod_image.png "Figure 4 - Add new columns")

:::hint{type="info"}
🖊<u>**Note**</u>**:** For each change in the information in the database/table or when creating the Business Object, you must execute the corresponding DDL to reflect the creation/changes in the database.
:::

## Relationship

If necessary, use the Relationships tab to create relationships between Business Objects.

1. Provide the following information:

- Whether the relationship **type** is One to Many (1 x N) or Many to One (N x 1);
- The **Relationship** **name** and the **Label** as it should appear on the form;
- The **Referenced object** that will be linked to the column being edited;
- **Column for auto-complete** which is the column in the referenced object that must be presented in the form instead of the value of the column being edited;
- If it is **required&#x20;**(mandatory) field;
- If it is to use **Delegation**, that is to use Generalization/Specialization concepts for the Relationship;
- Set the **Object column in the edition** that will be part of the relationship.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/NG5E7taQVwXtaH3pqaS67_image.png "Figure 5 - Relation")

## Business Rules

Select the Business Rule to be executed when insert, change or delete actions are triggered on the Business Object.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/Erx_UJgQRLIYBdG8B5x3H_image.png "Figure 6 - Business rules")

## SQLs

You can create SQLs queries for the Business Object to be run on specific situations according to your process/business needs. For example:

- In an ITSM service request flow for enrolling in a particular course, an SQL query can be used to obtain the number of students already enrolled in that course and make an automatic decision to allow or not the application for enrollment, or send the request to a waiting list.
- During the registration of an item in the Business Object table, an SQL query, which joins several tables, can be executed to validate information being input in the form.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/6p_QC50RTXtXMXBbIg7z6_image.png)

## Form (CRUD & Custom)

It is possible to change labels names using the Labels tab, and edit the grid fields using the Grid tab.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/gELve8hd7kwmhHnmfco35_image.png)

When you click Edit Form in the screen header, a form for that Business Object will be generated and the Fields sidebar will be displayed. If there is already a registered form previously linked to this Business Object, the Design View tab for this form will open.

