Field-level real-time custom validation for a model

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I am new to skuid. in my model fields, i have requirement like for "Phone number " field only supports digits and length should be 10. another requirement like for "Name" field only supports characters and digits(numbers) are not allowing.can any one tell,how to approach for this requirement.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Hi, Raj,
While Skuid handles some page-level validation (e.g. making a field required at the page level), Skuid doensn't have an out-of-the-box feature that handles logic that advanced right now. I would suggest one of two options:
  1. Use standard Salesforce validation rule.
  2. Write a custom field renderer with JavaScript that handles the validation. (Here's a bit of info on custom field renderers)
If you want this validation to apply org-wide (not just in a single Skuid page), I would definitely recommend the first approach. It is probably simpler and will ensure the validation will always be run when users are entering data. If you want to handle this logic just in a single page, you will probably have to go the JavaScript approach.
(Edited)
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
for specific field, where i have to write my custom logic. example: for first name supports only characters not numerics and special characters. for this in field-level, where i have go to write my custom logic means step by step and validation script code
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Raj,

As emily said above, there is nowhere in skuid that you can write a validation rule to apply to a field every time you use the field. You can write a javascript snippet and us it as a custom field renderer, but you will have to manually apply the custom renderer every time you use the field.

Here's the documentation on field renderers: http://help.skuidify.com/m/11720/l/214147-skuid-ui-field-renderers

And the community has lots of examples.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
can u pls provide the community likns
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Search the community for "custom renderer".  Look to the right under Related Conversations.