Using Form Rules and Variables in Resco Mobile CRM

Sometimes just being able to interact with your Dynamics data in the field isn’t enough, there are times when we need to be smarter to get the most out of the user experience. For those occasions there are Form Rules…

Everyone who’s anyone using a mobility solution for Dynamics CRM seems to be turning to Resco Mobile CRM as their weapon of choice. It is easy to see why, especially if you require a ‘configuration over development’ focused solution. One of the key factors with using Resco is the requirement to configure additional mobile forms for your entities outside of the Dynamics application.

In the Dynamics UI it is possible to use business rules out of the box to determine dynamic field behaviour such as;

  • Hide/show fields
  • Set the requirement level of a field
  • Set the value of a field

Business Rules are a great alternative to using JavaScript, however the behaviours defined by a business rule are not mirrored in the Resco application, especially when the record has not yet been saved. Resco does however offer an alternative, Form Rules.

There is a full “Rules Guide” available for download via the Resco website which provides a short tutorial and a table of the Function Types that can be called in a rule; click here

Why Use Form Rules?

Form Rules (or Mobile Workflows) in Resco Mobile CRM allow for the standardisation of form and field behaviours, validation and the use of variables based on user input. The best part is that there is no need for programming (just like business rules in Dynamics CRM).

The feature was first implemented in 2012, so is quite mature and offers additional capability to the customisation of Resco Mobile CRM for your users.

When Do I Use Form Rules?

The answer is; whenever you need to modify or validate your forms or fields based on user input in the Resco Mobile CRM app. The rules can be triggered On Load, On Save and On Change as per the Form/Field Events in Dynamics CRM.

How Do I Use Form Rules?

Simple, once you have an established Mobile Project then you can open one of your entity forms and the Rule Editor is launched on click of either the On Lead, On Change or On Save buttons in the ribbon menu.

  • On Load – means the rule is executed when the Edit Form is opened
  • On Change – means the rule is executed on opening of the Edit Form and also every time a value of one of the form fields changes
  • On Save – means the rule is executed when the Save button is selected

Each rule can have conditions, function steps and variables which together provide the logic required to execute the validation or behaviour change you require.

RescoRules01.PNG

Rules have assigned variables which uses a property to define the scope for the rule to be executed, such as; Entity, Form, Tabs (Views) etc. I have included an example of a simple rule below to illustrate how each component is used, in the example we will throw an error message when there is no data recorded for “Email”.

PLEASE NOTE: This example uses a rule triggered On Change, similar rules can be triggered On Load, but as I want the user to add a value and then the behaviour of the form to change, this is the better option.

  1. So, to get started – open the Woodford tool and open your project, if needed; see my previous posts on setting up a new project in Woodford here. Then navigate to the account edit form.
  2. In the Account edit form click “On Change” to add a rule.

Conditions:

     3. Click “Add Condition” in the rules editor ribbon menu.

A condition allows for us to include “If” statements in order to execute the rule, for example; “IF Entity.IsNew Equals True” – this condition would mean the rule function only applies to new records. Likewise we can create a condition that looks for a field value such as “Email”; ‘If Entity.emailaddress1 Does Not Contain Data”.+

+Addendum 25/4/17 – If you want to limit when the rule is triggered to the load of the form and where the change field is updated you can add a condition at the beginning of your rule; if ChangedItem Equals <fieldname> – this will have a performance benefit as per the comments from Lukas below. So in this example; if ChangedItem Equals emailaddress1. (Thanks Lukas!)

Conditional strings are added using the pop-out Condition Editor.

RescoRules02

After we have defined a condition, we can also add a conditional branch or “Otherwise” statement in the rules editor. You not need to have a condition if the rule will apply to all records in all circumstances.

Functional Steps:

     4. Click “Add Step” in the rule editor ribbon menu

Each functional step allows us to add a variable which requires us to select a “property”, then an “attribute” and a “function”. We can only add a function when the variable has been set.

An example of this could be; “Form.emailaddress1.ErrorMessage” – where Form is the property, emailaddress1 is the attribute and ErrorMessage is the function.

We would then set the action, such as; “Assign” or “Clear” or “Add Suffix” to the function. In this case I am going to use assign – and add a string to display as an error message. So, my complete function is; Form.emailaddress1.ErrorMessage Assign “Email Address is Required” (as per the screen shot below).

RescoRules03

There is currently no way of setting a the requirement level of a field outside of CRM, so the above example is useful when you want to have the users add data via Resco that isn’t always ‘required’ in CRM.

PLEASE NOTE: If you want to modify a value of a field on your form you will need to use the “Entity” property in you rule. “Form” properties can be used for hide/show, disable/enable or set an error message for the field selected.

     6. To round off the rule I have added a conditional branch as per the image below

RescoRules04

The Result:

Once you have validated your rule using the “Syntax Check” option in the toolbar, save and close the rule and then publish the changes to your project. Then load and sync your device app, the result should be similar to that in the image below. Note that the “Email” field is red, this means the form with expect a value for nay new record added via Resco, if a user attempts to save the record the Resco app throws our error message.

RescoRules05

 

 

Using Variables

One very useful part of the Form Rule toolkit is the ability to add variables. You can define a variable that is added to the “property selector” in the current rule. This is particularly useful when looking to use more complex conditions or data from a related entity in your rule definition.

Once created, we can call variables in our rule when we are adding conditions and steps.

In this example I will create a variable used on the Email form (edit form) in Resco to pull in the Primary Contact (primarycontactid) value from the regarding account into the description for my greeting. I will use the Concat function to create a text string in the email body;

Step 1 – Open the Email edit form in Woodford and click the “On Change” button in the ribbon

Step 2 – Select “Add Variable” in the rules editor ribbon menu, then define your variable; in this case the property is “Entity”

Step 3 – give your variable a name, here I have used; “RelatedAccount”

Step 4 – In the next option set, select; “Load Reference” (as we are looking to find data on an associated record) and then choose “account” form the list of associated entities and then click “Ok”. The variable is ready to use.

PLEASE NOTE: The related entities in this list also need to be sync’d with Resco for selection.

Step 5 – Select “Add a Condition” then; select your variable from the list and the field, in this case “primarycontactid” then select “Contains Data”

Step 6 – Add a new Step; Entity.description Concat (this gives two arguments)

Step 7 – Add the salutation to the first text area (in this example “Dear”), then in the second click the side button to “choose variable” and then; RelatedAccount.primarycontactid

The resulting variable and rule steps should look like this;

RescoRules06

Step 8 – Save and Close then Publish your changes to your project.

The Result:

Synchronise the Resco app on your device and then navigate to accounts and open a record with a primary contact associated. Open the create email dialog in the activities list, the concatenated values from our rule will be added to the email body.

The same principle applies to adding name strings or text in other fields, Concat3 allows you to use another value or variable when creating a string. You can also use; Add Suffix and Add Prefix to add to an existing text string.

PLEASE NOTE: It is also possible to create Shared Variables in Woodford, the example provided is using rule specific variables. For more complex calculations or logic you may need to look at the JavaScript bridge for Resco.

This is a brief intro to the art of the possible with Resco Form Rules, but this post just scratches the surface. If you don’t have access to Resco and Woodford you can download a full trial from Resco.net

Thanks to Jo for the prompt on this post – hope it is useful to some of you and happy mobile CRM’ing! 🙂

 

 

 

 

Advertisements

Resco MobileCRM – Adding a Digital Signature to Forms

In previous posts I have walked through working with Resco Mobile CRM and the Woodford app’ to create mobile projects and design forms (see: http://wp.me/p3wxxT-1s). During a recent project I was asked if we could enable the use of digital signature capture for users in the field. Happily this is a feature that can easily be pushed to my client’s devices using Resco Mobile CRM.

The quality of the signature captured will largely depend on your device(s), i.e. if your device has a stylus this will greatly improve the ability to capture a decent signature, even though you can use a finger for a touch interface or a mouse for the Resco application on a laptop etc. – but whatever you capture can be fed back into CRM regardless. If you are online or offline (sync’ required for offline use).

The functionality could be useful for a multitude of scenarios in the field, such as Sales Opportunities, Application Forms, Delivery Confirmation or Approvals to name but a few.

Here is a short walk-through for adding the signature functionality to an entity:

Step 1 – Load your Mobile Project

Navigate to your CRM instance and then go to Settings > Woodford > MobileCRM Woodford, the Silverlight application will launch. Go to “Mobile Projects” in the left hand navigation areas and open your project, (if you need to know how to set up a project in Woodford check out my earlier post here http://wp.me/p3wxxT-1a).

Once you have opened your mobile project navigate to entities and click to expand the entity you will be working with.

CRM_app_launch1

Step 2 – Form Design

Once you have selected your entity click to expand the list and click “Forms”, from the main navigation area open your “Edit Form”, (if you do not have an edit form and want to create one see my earlier post on designing a form, the link is at the top of the page).

In the form designer once you have the fields and list views you need for your entity, navigate to the “Add Media” option in the toolbar.

Add_Signature

In the “Add Media” pop-out menu you will be able to select “Signature” from the options, once you have added a “Name” and selected the required media to be captured you will be able to assign “Statuses” that require a signature if that is what suits your scenario (this could be useful for an approval for example, the user would need to add a signature in order to move the record to “Approved”), and set the “Subject” line to be included when the media is committed.

Note: There are a number of actions available in the Add Media menu, such as; capture photo, select photo, select file, record audio and record video. You can add multiple media tabs to your form, so you can have a tab for signature capture and another for photo capture for example.

Add_Signature2

Click “OK” to confirm. Your media tab will then be added to the form design, if you need to update or edit all you need to do is double-click the tab, in this case “Capture Signature”.

Add_Signature3

The next thing you will need to do is “Save” or “Save and Close” your form to commit your changes. Once back in the project screen make sure to validate then publish your project.

Step 3 – Test Your Signature Tab

Now you have added your media tab and selected the signature option you will want to test your changes, to do so launch the Resco MobileCRM application from your device, make sure you synchronise (this may take a few seconds) and go online.

App_Sync

Once you have synchronised the app’ navigate to your entity and either open a record or create a new record, make sure all required fields are completed and click your new “media tab” – in this example I called mine “Capture Signature”.

Simply write on the screen with your chosen implement, (or finger) and click save. Depending on your sync’ settings you may need to re-sync’ with CRM for your changes to be committed.

App_Signature

You can check the results in CRM, if the data from your device has been synchronised with CRM then navigate to your record in your chosen UX, be it web-based or Outlook, and click on the “notes” option in the Conversations Tab – and there is your signature!

CRM_Signature

I hope this was useful, if you need any further information on using Resco check out the Woodford Guide or speak to the helpful folks at www.resco.net – happy CRM’ing.

Working with Resco Mobile CRM: Part 3 – Designing Forms

Previously I have written about installing the Woodford App’ for Resco Mobile CRM and setting up a new “Mobile Project” – which you can find here: http://wp.me/p3wxxT-1a. In this part I will attempt to walk through some of the basic design functions that can be used to configure the content accessed by users.

Three of the main areas you will likely consider for configuration in Woodford are:

  • Fields
  • Views
  • Forms
  • The Home Screen

Creating Forms: In my last post we identified entities and fields from our CRM instance and added them to a Mobile Project, once you have done so you can either configure a form or create a new one. As in CRM the forms you create will be used to add and edit records when they access the application, you can also view related records and show additional tabs such as; I-Frames, Maps and other special media, (in Woodford these could provide functionality like photo or signature capture, particularly useful for users working in the field).

There are 2 types of forms: Contact Information Forms and Edit Forms. Contact Information Forms allow you to display fields and associated records. An Edit Form is where you can enter and edit data. In my recent work with Woodford I removed the existing Contact Information Forms for out of the box entities as they weren’t required, but this will largely depend on your requirements. If you don’t want to use these forms you can select the form an click “Delete”.

To create a new form navigate to; Settings > Woodford > Mobile CRM Woodford in your CRM instance, once the Silverlight application launches open your mobile project and scroll down to Entities > Select your Entity > Expand the Entity > Click Forms, (in this example I will be using Contacts) > navigate to the toolbar > Click New. You will then need to give the form a Name and a Type, here you can choose “Contact Information Form” or “Edit Form” – depending on the functionality you want to deliver.

new_form

Once the “Designer” form has loaded, (for new forms this will be blank) you can navigate to “Add Fields” from the toolbar, upon clicking the button you will see a drop down list of the fields you enabled previously. Once you have clicked to select your first field the “field explorer” list will be populated with all other available fields which can be added to the form by double-clicking the field name. You can drag and drop fields around the form for placement as well as from the “field explorer” list on the right of the screen.

Note: You can remove fields by either dragging them away from the form, or clicking “delete” in the toolbar. You can also edit the form properties on the left of the designer area once a field is selected.

new_contact_form1

In the form designer there are some key functions that you may want to re-use in addition to “Add Fields”: Add Detail – adds a ‘Tab’ as in CRM, Add List – adds an associated entity view. Add Spacer – useful to enter a break between fields as in CRM itself.

To Add a List you can either select a Detail or a List element in the designer, available lists are then visible in the “field explorer”, or by selecting from the toolbar. You can add lists that use related and unrelated entities, lists can display associated Activities, Notes, Opportunities etc. in your form.

When you have added your fields, detail tabs and lists don’t forget to hit “save”, or “save and close”. Once you have closed the form you can click “Publish” in the toolbar, you can also choose to “Validate” your mobile project – this will check for any errors in your configuration.

Note: You can also check for errors in the “About” sections of the Woodford app’ and the client version on the user’s device or laptop.

For more detailed information you can download the Woodford Guide from www.resco.net

new_contact_form

new_contact_form To Whenlick on ̍Newˈ.

Type: select ̍Public ViewˈChoose a template (shows the number of fields on the view, you can add more fields later on when designing the vie