Skip to content

Add & Edit Loyalty Customer Forms

The Add and Edit Loyalty Customer forms are uniquely-formatted forms built with particular form fields to show up in certain parts of the screen, regardless of the order of the form field records. he form is built to support capturing different levels of personal information as part of the Add/Edit process, as each retailer will have their own definition of what information is important or necessary to capture.

This document details how certain parts of the Add & Edit Loyalty Customer forms can be configured in various ways. These forms are driven by the CTX_FORM and CTX_FORM_FIELD records with the loyaltyAdd and loyaltyEdit FORM_IDs, respectively.

Phone Numbers

Phone

The most common configuration for capturing the customer's Phone number is via the PHONE Field Type for the Form Field record. This field type limits the input to only accept numbers. This type also comes with an additional benefit of being i18n-friendly and can format the phone number based on locales in real time when entering numbers into the field.

Freeform ALPHANUMERIC Phone Numbers

If the formatting and input validation of the PHONE type is too strict for a retailers needs, a Field Type of ALPHANUMERIC can be used instead of PHONE. The CTX_FORM_FIELD record has a PATTERN field that can be used to supply regex for form field validation, but this implementation will not provide realtime pattern formatting in the same way the PHONE type does.

Phone Field with Readonly & Non-Captured Country Code Prefix

Should there be a desire to emphasize to POS users that the country code should not be entered as part of the Phone Number, the Loyalty forms can be configured to display a readonly Country Code value that is not captured when the Add or Edit Loyalty Form is submitted. This effect can be achieved by adding a new FormField record with a FORM_FIELD_ID value of "countryCode" and a DEFAULT_VALUE equal to the text desired to be shown to the left of the Phone Number input field.

Phone Field with Captured Country Code Dropdown

Some retailers may have needs to support Loyalty Customers with different Phone Number country codes. Should this be the case, the CTX_FORM_FIELD record for the "phone" FORM_FIELD_ID can be set to have a Field Type of COUNTRY_CODE_PHONE.

When using this FormField Field Type, the application needs to be configured with the following keys.

openpos:
  phone:
    DOC__supportedCountryCodes: "The supported Country Code value options when interacting with country-code-supported phone numbers"
    supportedCountryCodes: +1
    DOC__defaultCountryCode: "The default Country Code value when interacting with country-code-supported phone numbers"
    defaultCountryCode: +1

Multiple Phone Numbers

Should a retailer have a need to collect multiple phone numbers from a Customer, the FormField record for this field can be set to have a FORM_FIELD_ID value of "phones" (note the plurality) and a FIELD_TYPE of PHONE_LIST.

The list of Phone Type options is defined in the CTX_CODE table under the "CustomerPhoneListType" CODE_GROUP_ID:

CODE_GROUP_ID CODE_ID DISPLAY_VALUE
CustomerPhoneListType Home key:customer:phones.type.home
CustomerPhoneListType Mobile key:customer:phones.type.mobile
CustomerPhoneListType Work key:customer:phones.type.work
CustomerPhoneListType Other key:customer:phones.type.other