- 14 Mar 2024
- 1 Minute to read
- DarkLight
Access Cards Must Have Set Number of Digits
- Updated on 14 Mar 2024
- 1 Minute to read
- DarkLight
This rule lets you control the number of digits required for all access cards you add to customers from the Admin Panel.
It is useful if your access cards have a set number of digits and you want to avoid any mistakes or typos when admins add cards to a customer's account.
Log in to dashboard.nexudus.com if you aren't already.
Click Settings > Validation rules.
Click Add rule.
Click on Manual entry.
Name your validation rule.
Add a Description for your rule to let other admins know what it does at a glance.
Toggle on This rule is active.
Select Customer as the rule's Record type.
Add the Error message to display if the validation rule is not met.
Add the following code snippet to the Formula field.
record.AccessCardId = null OR record.AccessCardId.Length = x
- Replace the x after record.AccessCardId.Length = with the number of digits you require for access cards.
In the example below, we added 10, meaning all access cards that we try to register for customers must be 10 digits.
record.AccessCardId = null OR record.AccessCardId.Length = 10
Click the Save Changes button.
All done! We recommend trying to assign an access card to a customer using the wrong number of digits to test your rule. If you see your error message displayed as you try to save your changes, you're good to go.