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)

Business rule does not allow saving

(0) ShareShare
ReportReport
Posted on by 790

dear all

i do have a business rule that checks a field value on the opportunity form, if condition is true, then i show error message next to one of the fields, the problem, is that once this Error is shown then i cant save any data on the form, so the user gets stuck, so what to do?

please check this example :

8030.6.png

thanks,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Ahmad ,

    This is by designed , even me too faced similar issue . I would suggest to make the field requirement at run time based on selected stage.

    function OnloadFormBPF() // Register the method in onload of the form
    {
        Xrm.Page.data.process.addOnStageChange(checkSelectedStage);
    }
    
    function checkSelectedStage() { 
    
        var stageName = Xrm.Page.data.process.getSelectedStage().getName().toString().toLowerCase();   
        var stageID = Xrm.Page.data.process.getSelectedStage().getId().toString().toLowerCase();
        if (stageName == "contract submitted")
        {
            Xrm.Page.getAttribute("FieldName").setRequiredLevel("required");
        }
    }


    Hope this helps.

  • Ahmad Saud Profile Picture
    790 on at

    thanks,

    so i just need to add the above code in a webresource,

    but in which event i have to call this function (OnloadFormBPF) ?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Yes you need to register the function OnloadFormBPF in the Onload event of the form.

  • gdas Profile Picture
    50,091 Moderator on at

    Hi Ahmad,

    Did you tried  the code which I have shared?

    Please close the thread if this resolved your issue.

  • Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    Are you saying even if you corrected the error you are not able to save ?? have you implement the else part in your condition?

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Ahmad,

    Could you share screenshot of your business rule here. I have tried it and it seems to work fine i.e. once the validation is successful, the message disappears on it own.

    "The record cannot be saved as long as this message is displayed. After the data in the field has been corrected according to the conditions set in your rule, the message will disappear and the record can be saved."

    technet.microsoft.com/.../mt826761.aspx

    Hope this helps.

  • Ahmad Saud Profile Picture
    790 on at

    thanks, it is ok now.

  • Ahmad Saud Profile Picture
    790 on at

    thanks it is ok now.

  • gdas Profile Picture
    50,091 Moderator on at

    Please close the thread.

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Ahmad,

    It is the OOB behaviour of business rule that you cannot save a record whilst a business rule error is being displayed, i.e. it prevents the record being saved until the error message is resolved.

    See: community.dynamics.com/.../crm-2013-business-rule-workings-limitations-and-exam-notes

    Hope this helps.

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