Skip Navigation
Expand
Setting a specific format or mask for Custom Object text fields
Answer ID 6967   |   Last Review Date 03/18/2019

When setting up a Custom Object text field, can I require a specific format for the field?

Environment:

Custom Objects, Field patterns

Resolution:

Yes, you can type a regular expression string pattern to define a format that will be used to verify the contents of the field. The carat (^) character is automatically added to the start of the pattern and the dollar sign ($) character is automatically added to the end. This ensures that strings entered in the custom object's field match the entire regular expression.

For example, if you want to create a field to store phone numbers in a format of 123-456-7890, enter a pattern of [0-9]{3}-[0-9]{3}-[0-9]{4}. Refer to Regular Expressions.

Another example, if you want to create a field with a format M732-13EN1, enter a pattern of ([A-Z][0-9][0-9][0-9]-[0-9][0-9][A-Z][A-Z][0-9]).

For additional information, refer to the 'Adding a field to a custom object' section in the Online Help User Guide documentation. To access Oracle B2C Service manuals and documentation online, refer to the Documentation for Oracle B2C Service Products.