Business Rule not working - dynamics-crm

I have made Business Rule for CRM and activated it, but it doesn't perform any action it should. It is activated, by the way.
I have checked the conditions multiple times and the look fine. I have also made JS Web Resource with the same conditions and it works.
The entity I am working with is custom entity(not activity). Is there anything I should enable on my entity to enable business rule, something like: Business Process Flows, Activities, Connections etc. or should I look for problem solver somewhere else?

When Business Rules have issues, they simply don't run (no errors, no nothing).
Make sure the scope of the Business Rule is correct (if you're not sure, pick the all forms option and safely forget about it).
Also, all the fields appearing in the business rule must be placed in the form body, if even only one is missing then the rule will not run. They can be locked and/or invisible if that's an issue.
Business rules that will be applied to Main and Quick Create forms, and to an entity, in the Web application and Microsoft Dynamics CRM for tablets. It is applied to the Main and Quick forms in the Outlook client in online and offline modes. (https://technet.microsoft.com/en-us/library/dn531086.aspx)
If all is good and the rule still doesn't run, clear it out then test it after each single change you make.

Related

How do I create a custom global element/app within CRM Dynamics such that it shows on all pages and can control user navigation?

I need to add a custom element/mini-app/extension to CRM Dynamics sales such that it shows globally on all pages that the user navigates to and also can navigate the users urls when certain events happen.
What options exactly do I have to satisfy the above criteria?
The screenshot below shows a sample area that I need to build the app within as an example.
Id imagine there are many use cases where customizing a global element is worthwhile, especially since custom applications may need to be built.
I understand I can use the Resources to create a SPA such as angular which is running so long as the URL stays at the SPA url. But for our use case, we are looking to allow end users to be able to navigate the CRM using the custom controls. but when something happens in a another subsystem, we need end users who are logged into the CRM to instantly view data that is important to them.
Is this technically possible?
Unfortunately this is not feasible. There are some concepts to show learning path like that. It won’t satisfy your need.
I understand what you need, like a news feed or ad rotator for rolling content but context specific flyout area which is always pinned. There is no OOB option or customization/configuration available for achieving this. You can initiate this concept in Dynamics Ideas.
Like you said there can be a HTML web resource developed & embedded in a dashboard, this is very limited for your requirement.
Edit:
I think you are looking for Channel Integration Framework which will help you to configure third party CTI apps.
In CRM V9, they have introduced a new API call for 'Panel'. This panel loads to the side of the screen, and can display content regardless of where the user moves throughout the entire application. I've played around with it a bit for my own person reasons at work, but it looks to be exactly what you're looking for.
The call is 'Xrm.Panel.loadPanel(URL/WebResource)'
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-panel
However, the feature is currently in development, and should only be used in production at your own risk.

CRM 365 Business Rules Deactivated but still running on forms?

I am in the process of re-writing the Business rules for our CRM Installing on Office 365. The problem is, the old ones I have decided to turn off due too the changes that are taking place on the new versions of the form.
However, when I deactivate the business rules the fields that were effected by the rules, are still effected.
The fields even know that the rules have been deactivated but continue to run.
I have also cleared my browser cache and used different machines so I'm pretty sure its not a client machine problem.
EDIT:
For security reasons I can't share the names of the business rules but I have attached an image to show they are deactivated.
In the design view of the form, for example there are these 3 fields:
However in the live view this is displayed:
Verify if "Visible by default" is unchecked for Tab/Section/Controls, that may be the reason why its hidden.
After disabling your business rule, you have to click on the "save" button. This is tricky. If you only disable it, you will get a message saying that the business rule is disabled, you also see the status of "disabled", but it is actually still running. As soon as you click in "save", the business rule stops running.

How to centralize validation rules in Asp.Net MVC 4?

Below is a sample scenario:
User can create and/or update a policy online. While updating, user may change the start date of the policy. Condition is, if policy start date has passed (means smaller than today) then, start date can't be changed, else it can be changed.
My problem is:
There can be 5 types of policies and each has some common properties as well as some uncommon properties. Now I want to validate those properties against my business rules (like the sample) from a centralized place (may be class or whatever). But I am stuck on how/where to start.
Currently trying:
Currently I am validating those properties inside Controllers and sometimes inside Views but that is requiring lots of manual work and code maintenance will be troublesome in future. Can someone please give some idea.
Environment:
Asp.Net MVC4, Razor, VS2013

How to lock a field based on user role?

The old way I've always done it was to trigger a script on load and set the fields to this or that (hiding, locking etc.). But since we got those new, cool, shiny business rules now, I thought I could give them a whack.
The problem is that I can't figure out how to specify a condition based on the current user's role... Where is it hiding?!
They are not hiding because they don't exist. Business rules have a limited set of capabilities and they can't check the role of the users.
If you just need to lock the field Field Level Security can be an alternative, but for CRM 2013 you can only use on custom fields.
However good old JS + Plugin enforcement is (in my opinion) the preferred way.

How do I sanitize a workflow uploaded by a user?

I have a multi-tenant application that may run arbitrary workflows as needed.
I plan on using the workflow designer to create these workflows, but even if I limit the Activities in the Toolbox, that doesn't prevent a malicious user from editing his own XAML file, doing activities I'd rather them not (specifically calling out to the .NET framework)
For a given workflow, how do I verify that the only actions being used are those I approve of? Is an XPath query the only way, or is there a feature within WF that will validate this?
If you need a visual introduction to what I'm looking for here is a sample project and video referring to it.
I'd just load the workflows in a sandboxed AppDomain. You can Use the GetStandardSandbox static method of the SecurityManager to set this up relatively easily (and safely).
Of course, I haven't actually done this yet, but I'm definitely thinking about adding some of this to my current WF code (which does use AppDomains to isolate execution of workflows from my application).
All you can do is load the XAML as XML and check what is in there. And make sure to check any VB expression entered as users can put interesting things in there as well.

Resources