Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Similarly, try updating a record, inserting an invalid character to the telephone number. Your validation should prevent you from saving this update.

Validate business contacts have business name

Next we'll add some additional validation to check that business contacts have a business name set:

Widget Connector
width900
urlhttps://www.youtube.com/watch?v=KCOe5XlmCCA&list=PLbPt6SI1Zhb_n3lXboTC_Qzq0Kg2x8LtT&index=9
height500

Add this validation to your app. To recap the steps in the video:

  • Open details for the action Validate Contact - you can either open the stream configuration form for Contacts, and find the list of actions; or click on the Add or Update button, and from the button configuration form, follow the quick link to the action details
  • Add a condition to the validation expression to check that for business contacts, the business name is set; make sure you remember you put a comma after the if() statement you already have in your expression, then add:
Code Block
if ( (_form.ContactType == "Business") && (isEmpty(_form.BusinessName)),
    error("Business name must be set for business contacts")
)
  • Save changes to your action

Go into App Mode. Check that the error is shown when users forget to enter a business name for a business contact.

Panel
Next chapter: TODO