How to add fields in Business Central

Business Central is a powerful enterprise resource planning (ERP) system that can be customized to meet your specific business needs. One of the most common ways to customize Business Central is by adding fields. By adding fields, organizations are able to monitor the information that is most critical to their business. There are several different ways that users may add fields to their Business Central environment:
- Personalization – with personalization, you can add already existing fields to your personal view
- Development – if you have software development or coding skills, you can add new and custom fields not included in Business Central’s native fields using extensions
- User Defined Fields Add-on – you can purchase an add-on to Business Central to be able to easily add new or custom fields, with no development skills required
In this post, we will walk through the different methods for adding fields.
Personalization
Business Central allows users to customize their workspace to suit their unique work and preferences. Users are able to personalize all types of pages and make various changes including adding new fields. When you personalize a card page the changes will take effect on all records of that type. For example, if you personalize a specific customer card by adding a new field, that new field will be visible on all other customer cards.
To add fields to Business Central using personalization, follow the steps below:
- Open any page that you want to personalize
- Select the Settings icon >> Personalize
- Select + Field
- From the Add Field to Page pane, drag the desired field from the list to a position on the page
Business Central’s native personalization functionality is a great way to customize your workspace. However, it has its limitations as any customizations that are made will only affect what you see, not what other users see. So if you want all users in your organization to see a specific field, each user will need to follow the steps above. Additionally, Business Central’s personalization feature does not support the creation of new fields. You can only add fields that already exist from a predefined list and are hidden by default. You must use custom development or the User Defined Fields add-on to create custom fields.
Development
It is possible to add new fields to Business Central using custom development and coding. To accomplish this task, developers will need to leverage table extension and page extension object types. Most tables in Business Central cannot be directly modified by developers. To add fields to a table, developers must create a new type of object called a table extension.
To create a table extension, open Visual Studio Code and follow the steps below:
- Create a new file for the table extension
- Create the table extension using ttableext snippet
Typing the shortcut ttableext will create a basic layout for a table extension object - Add the extension name, id, and table name to extend
- Add a new field to the table using the tfield snippet
- Enter the field id, field name, and data type
In our example, we created a table extension for the Customer table and added the RewardPoints field. Once the new field is created, you will need to create a page extension and place the field on the page. In our example, we will create a page extension object to extend the Customer Card page by adding the RewardLevel and RewardPoints field controls after the Name field control on the page.
To create a page extension object follow the steps below in Visual Studio Code:
- Create a new page extension file
- Create the page extension using tpageext snippet
Typing the shortcut tpageext will create a basic layout for a page extension object - Enter the id, name of extension, and table name
- Design the layout portion to choose where the new field will be added
Keywords are used to place and move fields on the page extensions. A list of these keywords may be found here. - Publish your changes by selecting AL:Publish or by pressing F5
Now our new, custom field will be added to our Business Central environment. If you want the new custom field to automatically flow to another table, more custom code will need to be written. It is also important to note that Microsoft performs updates on Business Central twice a year. This means that any customizations, such as the ones performed above, would need to be retested after every update to ensure they still function properly.
User Defined Fields Add-on
Rand Group has developed an intelligent application for Business Central to simplify the process of creating custom fields. Our User Defined Fields add-on enables organizations to create up to 100 custom fields that flow through the system with no coding required. Custom fields can be created for customer, vendor, item, resource, and job tables. For each field you can choose from the following types of fields:
- Code – Alphanumeric in all uppercase letters
- DropDown – A list of values that can be accessed through a drop-down arrow
- Lookup – A list of values that can be accessed through a lookup ellipsis
- Date – MM/DD/YYY
- Boolean – Yes or No
The User Defined Fields will also appear on corresponding sales and purchase documents. There are set up options that allow you to define if a copy of the values will flow to the document from the master record and if they will be editable. Additionally, you can determine if you would like the User Defined Fields to also flow through to customer or vendor ledger entries upon posting. To create a new custom field using the User Defined Fields add-on, follow the steps below:
- Search for and select User Defined Fields Setup
The User Defined Fields Setup page will list all the available predefined fields - For each custom field you wish to setup, the following properties may be defined:
- Field Caption: This is the name of the field and what users will see in Business Central
- Enabled: This enables the field to be visible on all related pages. For example, a customer field will be available on the Customer List and Customer Card pages, as well as sales document pages, and the Customer Ledger Entries page.
- Editable: If a field is marked editable then users can edit the value of the field on related pages.
- Text Length: This defines the length for the fields with Code as the Field Type. The maximum length is 30.
- Copy To Documents: This option enables the value of the user define field to copy from the master record to sales or purchase documents. Customers, Items, and Resources can copy to sales documents. Vendors, Items, and Resources can copy to purchase documents.
- Read Only On Docs: This marks the fields as read only on the sales or purchase documents
- Transfer To Ledgers: This option will transfer the value to ledgers. Only customer and vendor ledger entries will have these fields.
In our example, we will create a custom field for customers called Service Status with a drop-down list of options including Accepted, Pending, and Declined. We will also create a custom field called Service Start Date where a user would enter a date. Additionally, we will set our fields to copy to sales orders, to be editable, and to appear on customer ledger entries.
Now that our new custom fields are enabled, they will appear on all corresponding customer pages. Additionally, they will flow to sales documents and automatically populate when the customer is entered. Our new custom fields will be listed on the customer and sales pages under a new fast tab called User Defined Fields and will be editable per our setup.
Next steps
Adding new fields to your Business Central environment is a great way to customize your system to meet the needs of your business. Business Central includes a limited set of fields that can be added to your pages using personalization. However, many organizations need to create custom fields that are unique to their specific business. To accomplish this, many have had to turn to custom development. To avoid custom development and streamline the creation of new fields, Rand Group developed the User Defined Fields add-on. To learn more about the User Defined Fields add-on or how to customize Business Central for your unique needs, contact us today.