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 :
Microsoft Dynamics CRM (Archived)

Prevent Default not working for Service appointment entity in crm2013

(0) ShareShare
ReportReport
Posted on by 785

Hi We are using CRM2013 onpremises and i want cancel save if some attribute value is null while creating form in service appointment entity , so  have used preventDefault method to cancel save ,however same is not working for service appointment and same code working fine rest of entities .Do we have any any limitation for service appointment .

following is my sample snippet .

function preventSave(context){
var loc = Xrm.Page.getAttribute("location").getValue();
if(loc==null){
context.getEventArgs().preventDefault();

}
}

if i used preventDefault for other entities then it is stop from saving form . however for service appointment it is saving records rather canceling save event, Any idea on this behavious ??? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Can't you use business rules/field's requirement validation?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    If you are just checking location null or not , then better you can make your location field as mandatory.

    So, you can simply avoid this script.

    Mansoor

  • prashant mirje Profile Picture
    785 on at

    for service appoitment we can't use business rules in CRM 2013

  • prashant mirje Profile Picture
    785 on at

    Hi Mansoor,

    i have to actual implementation where i have more than 25 radio button's(check box) are on form . where i have to check whether user has selected at least one check box .

    if user hasn't select any check mark and try to save then i want cancel save and show alert .the given code snippet is for just checking behavior and which is behaving weird for service appointment only.for rest of entities it works perfectly.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans