Auth0 Angular 10
Apex Designer Documentation
What's New
Getting Started
Projects
Business Objects
Processes
User Interfaces
App Behaviors
Files
Dependencies
Project Settings
Libraries
Patterns and Best Practices
App Showcase
Angular 10 Base Library
Frequently Asked Questions

Business Object Base Types

Extend the native data types with validation

Blank Profile Image
Written by David Knapp
Updated a year ago
2 min read

When developing a project, the accuracy of your data is very important. Using a reusable Business Object Base Type lets you extend native types with validation using limits, a predefined set of choices or patterns. Centralizing validation in a single location makes updates simple. It could also lets citizen developers use pre-determined field types developed by more technical team members. The Base Types library includes some Business Object Base Types for some commonly used types (e.g. Currency and Email Address).

Create a Base Type

To create a base type, create a normal business object on the Business Objects Page. When it opens on the Business Object Page, click the settings icon button settings in the upper right corner to open the settings dialog and change the Type field to a Base Type.

Setting dialog

After you close the dialog, the Business Object page will look different:

Base type page

The "Native Type" field defines what the underlying type is. It can be string, number, Date or boolean. After you select the native type, additional fields will be displayed based on type.

String Native Type Validations

String native type has four validation fields:

  1. Minimum Length
  2. Maximum Length
  3. Pattern
  4. Valid Values

Valid Values

In our example, we have added 4 options for a status in the system

Base type settings for status

Pattern Validation

If we wanted to validate a type using a regular expression we could use the expression field for the pattern and the Invalid Pattern Message field for the error message to display when the entry does not match the defined pattern.   We can take a look at the EmailAddress base type from the Dynamic Components library to see how this is accomplished.

Base type settings for email address

The pattern defined here will allow and unlimited number of character including letters, numbers and a few special characters (._%+-) followed by an @ sign which is followed by a domain consisting of letters and numbers, a period and an extension of letters between 2 and 4 characters in length.  If the entered data does not match that pattern the invalid pattern message will be displayed.

Number Native Type Validations

Number native type has four validation fields:

  1. Minimum Value
  2. Maximum Value
  3. Fixed Decimal Places
  4. Display with thousands separator

The other native type that can be extended is a number.  Creating a base type with a native type of number allows you to specify a minimum and maximum value for the field.

Base type settings for number

 

 

Powered by Apex Designer
Terms of ServicePrivacy Policy
© 2017-2024 Apex Process Consultants