Skip to main content
Post a question

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

getEventArgs().preventDefault not working in UCI

Posted on 30 Oct 2019 09:15:21 by 10

I have encountered an unexpected error. The problem is that the code we used to restrict saving via script is no more working in Appointment entity post wave 2 update it seems. Even in trial I faced same issue only for Appointment entity. The code still work in classic web forms & even in other OOB or custom entities too.

Form Customization:

pastedimage1572499697785v1.png

Handler:

//Functoin to call on save
function onSave (executionContext) {
//Local variables
var functionName = "onSave";
var saveEventArgs = null;
try {


//Get save event arguments
saveEventArgs = executionContext.getEventArgs();

//Prevent Save
saveEventArgs.preventDefault();


}
catch (ex) {


Appointment_ShowAlertDialog.throwError(functionName, ex.message);


}
}

  • Suggested answer
    crm development Profile Picture
    crm development 870 on 26 Aug 2021 at 09:43:37
    RE: getEventArgs().preventDefault not working in UCI

    Hi,

    Please check below post.

    https://anandwanidynamicscrm.wordpress.com/2021/08/26/geteventargs-preventdefault-javascript-is-not-working-in-appointment-in-dynamics-crm/

    Thanks,

    Anand

  • larry schondorf Profile Picture
    larry schondorf 15 on 19 Nov 2020 at 19:34:16
    RE: getEventArgs().preventDefault not working in UCI

    I have done all the steps and turned it to false, but I am still getting the error when preventing save?

  • Suggested answer
    Linn Zaw Win Profile Picture
    Linn Zaw Win 3,405 on 10 Jun 2020 at 09:27:50
    RE: getEventArgs().preventDefault not working in UCI

    Hi alketa

    That is the known bug in Scheduling Engine on the appointment form. I have documented the symptoms of the issue in my blog post below. Please contact Microsoft Support to provide you with the tools (FCB.Editor) and instructions to disable the scheduling engine.

    http://linnzawwin.blogspot.com/2020/01/model-driven-apps-find-out-why.html

  • alketa Profile Picture
    alketa 5 on 10 Jun 2020 at 08:42:40
    RE: getEventArgs().preventDefault not working in UCI

    Were you able to fix this problem?

    I'm having the same issue on Appointment entity in the UCI only.

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on 30 Oct 2019 at 16:59:09
    RE: getEventArgs().preventDefault not working in UCI

    This looks like a specific bug, so please get in touch with the support team to analyze this in more details, understand the root cause, and identify potential workarounds and fixes.

    admin.powerplatform.microsoft.com/support

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans