Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent 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