Posts Tagged ‘Business rule’

D 365 – Set Recommendation on a field using JScript/Business Rule

In this article I am going to detail the steps to set a notification (i.e., Recommendation/Error) to a particular control on the form.

Notifications can be of 2 types; Error or Recommendation.

  • If an ‘Error’ notification set, a red “X” icon appears next to the control. Setting an error notification on a control blocks saving the form.
  • If a ‘Recommendation’ notification set, an “i” icon appears next to the control. A recommendation notification does not block saving the form.

To explain this better, I am taking below scenario

  • If ‘Account Name’ is ‘Microsoft’ recommend to set ‘Ticker Symbol’ to ‘MSFT’

Recommendation - 1

  • From the recommendation, if I click on ‘Apply’, set ‘Ticker Symbol’ to ‘MSFT’

Recommendation - 2

Setting Recommendation using ‘Business Rule’:

Create a new ‘Business Rule’ with below components

Recommendation - BR 2

  • Add a “Condition” flow with condition (If ‘Account Name’ = ‘Microsoft’ AND ‘Ticker Symbol’ <> MSFT)
  • If condition met, add ‘Recommendation’ action
  • Under ‘Recommendation’ action, add sub Action, set ‘Ticker Symbol’ field to ‘MSFT’

Recommendation - BR 1

Setting Recommendation from JScript:

Register this function on form ‘onload’ and ‘onchange’ of ‘Account Name’ field.

function setRecommendationOnAccountName() {
var ctrlAccountName = Xrm.Page.getControl(‘name’);
var accountName =‘name’);
var tickerSymbol =‘tickersymbol’);

// Check condition (If ‘Account Name’ = ‘Microsoft’ AND ‘Ticker Symbol’ <> MSFT)
if (accountName.getValue(‘Microsoft’) && tickerSymbol.getValue() != ‘MSFT’) {
var actionCollection = {
message: ‘Set the Ticker Symbol to MSFT?’,
actions: null

// Add sub Action, set ‘Ticker Symbol’ field to ‘MSFT’ and clear Recommendation
actionCollection.actions = [function () {

// Set the Notification to ‘Account Name’ control
messages: [‘Set Ticker Symbol’],
notificationLevel: ‘RECOMMENDATION’,
uniqueId: ‘notify_account_name’,
actions: [actionCollection]


  • notificationLevel : Valid values are either ERROR or RECOMMENDATION. If nothing specified in object definition, it is set to ERROR by default.


Quick Create Forms – CRM 2013

‘Quick Create’ form is the latest addition in CRM 2013 new set of features.

‘Quick Create’ form enable you to create records quickly by just filling the key information (i.e., fields) using global ‘Create’ button.

Global Create Button

Global Create Button

In this article I would like to provide few key points about ‘Quick Create’ form

  • To enable ‘Quick create form’ for an entity, you have to check “Allow quick create” check box under Data Services in entity properties.
Allow Quick Create

Allow Quick Create

  • To create a new ‘Quick create form’, go to Entity -> Forms -> New -> Quick Create Form
Quick Create Form

Quick Create Form

  • Quick form only contain one Tab and three Section , we can’t add new tab or section.
Quick Create Form Design

Quick Create Form Design

  • Publish the Customizations.
  • Click on global ‘Create’ button on Navigation bar and select the entity and you get the form
Quick Create Form

Quick Create Form

‘Business Rules’ on Quick Create forms

  • ‘Business Rules’ work on ‘Quick Create Forms’
  • To enable ‘Business Rule’ to work on ‘Quick Create Form’, we just need to set the scope of ‘Business Rule’ to ‘All Forms’.
Business Rules Scope

Business Rules Scope

I will keep adding few more points, if I come to know.