Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to avoid form saving when logic fails.

Posted on by

Hello All Experts,

I want to do simple logic while saving the form.

if (validate)

then save

else 

alert('');

is it possible to do like this.

*This post is locked for comments

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: How to avoid form saving when logic fails.

    Hi,

    You could use Javascript to avoid form saving.

    See the link below.

    neilparkhurst.com/.../javascript-prevent-save

    social.microsoft.com/.../stop-saving-a-form-using-javascript-crm-2013

    Hope this helps.

  • Suggested answer
    Priyesh Profile Picture
    Priyesh 7,392 User Group Leader on at
    RE: How to avoid form saving when logic fails.

    Hi,

    You can use this where you think the form should not save further:

    msdn.microsoft.com/.../gg509060.aspx

    execObj.getEventArgs().preventDefault()

    Hope this helps.

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: How to avoid form saving when logic fails.

    Hi

    you can use the saveEvent.preventDefault();

    Have a look at the below post:
    https://community.dynamics.com/crm/b/crmandunifiedservicedesk/archive/2015/11/11/javascript-prevent-save


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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans