&tl;dr
For a custom validator to work on a user profile page, the validator must have validationGroup set to “Profile“.
I’m trying to apply custom JavaScript validation on Profile Page but it acts like it ignores any of my script validation. Adding trace shows the custom JavaScript code is added but I never entered custom validation logic (like webFormClientValidate function or Page_Validator validators collection). Anyone?
Tanguy “The XRM Toolbox” Touzard
Colin “Portal Keeper” Vermander explains why it’s a challenge:
The profile page is still an aspx page and might be harder to hook into. You can change it to a web template with a standard entity form and then you can do what you like normally.
Jim “Actully James” Novak couldn’t help himself to dig deeper:
I just tested with a simple null validator on the job title field. I see that the validator in the Page_Validators array, but its not being called! So must be the custom aspx not working the same as entity / web forms.
Solution
And finally, Tanguy helping Tanguy:
Found it! I had to specify the same validationGroup in my validator, which is “Profile” for the profile page. (tj – Once the group is specified, the validator kicks in as usual).
saved me, thanks!
I’m getting the same issue but on my custom entity. When you say “I had to specify the same validationGroup in my validator, which is “Profile” for the profile page”, are you referring to ‘Validation Group’ property of under Form options? What should be the name of the group in case of a custom entity?
“Found it! I had to specify the same validationGroup in my validator, which is “Profile” for the profile page. (tj – Once the group is specified, the validator kicks in as usual).” — This paragraph saved me so much, thank you for this!!!