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)

Debug Business rule

(0) ShareShare
ReportReport
Posted on by 432

Is it possible to debug a business rule in Dynamics CRM? Appreciate your help here.

*This post is locked for comments

I have the same question (0)
  • joman Profile Picture
    617 on at

    business rule is a javascript you can find it by press F12 on a form. It locate somewhere in Dynamic scenarios, but find it is not easy.

  • Akhil101 Profile Picture
    432 on at

    Hi Jomon,

    I was able to find Mscrm.BusinessRulesScript.Initialize(s). After opening the CRM form press F12 to get the debugging tool opened then select Script then click Start Debugging and search for Mscrm.BusinessRulesScript.Initialize and I found them under Dynamic Scripts -> Script Block (154).

    My question is how can we recognise which is the business rule we want to debug and also where to set the break point?

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    I do not think it would be useful to debug JavaScript code rendered for Business Rule.

    You cannot put break point, the way you expect (like each condition or action as a single step).

    So, you cannot debug a Business Rule.

  • joman Profile Picture
    617 on at

    [quote]My question is how can we recognise which is the business rule we want to debug and also where to set the break point?[/quote]

    Set breakpoint you can directly in a block.

    About "how can we recognise" - depends, what we need to do.

    Business Rules has scarce functional. Usually they don't need to be debugged.

    If it work not like you need, you can find a mistake in a rule definition directly without debugging actions.

  • Akhil101 Profile Picture
    432 on at

    Hi Jomon,

    There is an issue where I am getting an unsaved changes even after saving the record. This custom entity has only business rules and no java script attached to it, so I tried deactivating all the business rules and this unsaved changes was gone, but when I activated again then the same issue. So I just wanted to know whether is it possible to debug a business rule.

    There is no mistake in the business rule since I am just setting the lookup field value in the custom entity.

    Thanks

    Akhil

  • joman Profile Picture
    617 on at

    You need to find a business rule, that make this changes.

    try to turn off all rules and then turn on by one and refresh a page.

    So, when you get a mistake, you'll find a rule, that make it.

    Then deactivate it and edit to remove mistake.

  • Akhil101 Profile Picture
    432 on at

    As I said earlier I have done all this.

    The business rule which causes this is just setting the lookup field value. There is no error in the rule still its showing unsaved changes for that particular rule. So I thought if it is possible to debug a business rule then I can find out the exact issue.

    Anyways thanks.

  • joman Profile Picture
    617 on at

    Remove a setting lookup from a rule, and you'll get no mistake.

  • Akhil101 Profile Picture
    432 on at

    That's like deactivating the rule. I just have one condition that is to set the lookup field. If I remove the condition, then what's the purpose of creating the rule then?

    Thanks anyways.

  • Akhil101 Profile Picture
    432 on at

    I replaced the business rule with java script and the unsaved changes is not showing now.

    If you get any article regarding how to debug a business rule, please do share.

    Thanks in advance.

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