web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

executionContext.getEventArgs().preventDefault(); not working for save and close button.

(0) ShareShare
ReportReport
Posted on by 69

Hi,

I am checking if the contact belongs to the organization (refer to image 1), if not throwing an error and cancel the save. 

I used executionContext.getEventArgs().preventDefault(); onSave event for Quick form. it didn't cancel the save. i looked at this article

https://crmtipsbyprm.wordpress.com/2020/08/01/executioncontext-geteventargs-preventdefault-is-not-working-for-save-close-button-click-dynamics-365/

Our team is trying to avoid Ribbon Workbench modification (avoid customization). Is there any other way to make this work? is any way I can disable the "Save and close " button when there is a validation error? 

image 1

pastedimage1657835159794v2.png

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans