Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I am currently using custom validation on Dynamics CRM portal using Page_Validators on Web Form Step
I noticed that the evaluationfunction is actually called TWICE every time I click Next/Submit
I put a simple alert(‘hello’); command inside the evaluationfunction and I can see the prompt twice.
Anybody has idea if this is by design or there’s something I did wrong?
What would be the best way to check if the evaluationfunction is already called so we are not doing twice the work inside the function.
I can confirm that it indeed does get called twice - nothing you've done wrong.
It gets called once explicitly by the Portal code when you click on the submit button, and then again as part of the regular process of the form submission.
If you don't want to do the work twice, you'd have to come up with some sort of caching mechanism. You might be able to count how many times it's been called, and only perform the work every second time, but I'm not sure if there are any cases where it won't get called twice. I'd recommend storing the result in a variable, and having your evaluation function use that variable if it is not null, and then adding another event handler to the submit click event that clears the variable. That should ensure you're only doing the calculation once per submit button click.
Hope that helps.
Thank you for this. I ended up using webFormClientValidate which only gets called once.
Business Applications communities