Entity Notification Workflow

Overview

Entity Notification Workflow is a plugin in Dynamics CRM and Resco CRM environment allowing admin to configure automatic notifications that are triggered by specific entity record creation/modification.

Plugin sends the push notification to specified users (or more exactly to mobile devices used by target users). Once user clicks on these notifications, the Mobile CRM app will open and it will display initiating entity record form. If the app is in offline mode and it doesn’t have that record yet, it will ask user to switch to online mode or to synchronize the data.

In addition to this functionality, admin can configure the notification category which defines a set of actions that can be done on the entity record immediately as it opens (let’s say „Sign quote“).

 

Dynamics CRM configuration

Entity Notification Workflow is a part of Woodford solution and it’s installed once an administrator connects the Woodford to the Dynamics CRM organization.

It uses the standard process configuration in Dynamics. To start the configuration, open the Settings/Processes and create a new process:

entity_notification_workflow_001

 

Specify events for which the workflow should be triggered and add the step „MobileCrm.Server.Plugins / Send Entity Notification“:

entity_notification_workflow_002

 

Press the Set Properties button and fill in the notification text and target user definition.

entity_notification_workflow_003

 

Notification parameters

Message property specifies the text that has to be shown in the notification. Special tag {entity} will be replaced by entity’s primary field value.

Category property optionally defines the category with a set of buttons that have to appear in the notification (see below).

User property defines a specific user that needs to receive the notification.

If User property is empty, the Team property can define the team which will obtain the notification.

If both User and Team properties are empty, the property UserLink can contain the logical field name of initiating entity which contains a lookup to user or team that needs to be notified. In our example, the notification is sent to the owner of initiating Quote, defined by „ownerid“ field.

Alternatively, the UserLink property can contain the XML with fetch request returning a set of Users that have to be notified.

 

Resco CRM Configuration

In case of Resco CRM backend, the entity notifications can be configured via Resco CRM management console in the Processes section. Create new process, define entity and events and add a new step „Server.Execute.Pugin.RescoCRM.Notifications.SendEntityNotification“ with following parameters:

entity_notification_workflow_004

 

Message parameter specifies the text that has to be shown in notification. Special tag {entity} will be replace by entity’s primary field value.

Category parameter optionally defines the category with a set of buttons that has to appear in the notification (see below).

User property defines specific user or team that has to receive the notification.

If User parameter is empty (or contains null lookup variable), the property UserLink can contains the logical field name of initiating entity which contains a lookup to user or team that has to be notified. In our sample, the notification is sent to owner of initiating Quote, defined by „ownerid“ field.

Alternatively, the UserLink property can contain the XML with fetch request returning a set of Users that has to be notified.

After specifying all the arguments, please Save the process definiton, publish the project and activate new process.

 

Defining Notification Categories with button actions

As we mentioned above, the notification definition can contain a category defining a set of buttons that have to be shown in notification and perform specific actions (like sign quote).

Mobile CRM has several pre-defined push notification categories: AcceptReject, ApproveDeny, OKCancel and ViewRecord.

A custom category can be defined in Woodford Localization section by defining strings „Push.[category]. “. In our case, we have to define the string „Push.SignQuote.Sign“:

entity_notification_workflow_005

When the notification is displayed by the client app, it takes current localization and displays all Push.SignQuote.XY texts as buttons below the notification text. In case of iOS, the notification has to be swiped left to uncover the buttons. There’s a limit on number of buttons on iOS – it can show at most two buttons. It’s not possible to show buttons for Windows Store app.

 

Handling notification buttons on entity form

If user presses the Entity Notification button, the Mobile CRM application is opened and it opens initiating record form. It doesn’t perform any further action by default. However, it passes the name of pressed button into iFrameOptions object to all Offline HTML iFrame included on the entity form.

To handle the notification button action, you have to include following Javascript code into you Offline HTML iFrame:


	MobileCRM.UI.EntityForm.requestObject(function(entityForm){
		///var options=entityForm.iFrameOptions;
		if(options && options.btnAction == "Sign") {denn
			//Perform signing action
		}
	}); 

Known issues

  • External user projects are not supported
  • Windows Store app doesn’t support notification category (buttons)
  • UserLink supports team as owner but it doesn’t take users from child teams (if other team is member of our team)

 

Troubleshooting

Notification isn’t sent:

  1. Make sure that the process is activated in Dynamics (in Settings/Processes)
  2. Make sure that workflow was created (open the process and make sure that new workflow appears when the event occurs). If it didn’t, open Settings/System Jobs and check whether the workflow isn’t pending (reports „In progress“ state).