...
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 | ||||||
---|---|---|---|---|---|---|
|
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 forContacts
, and find the list of actions; or click on theAdd
orUpdate
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 |