The new ‘Image’ field introduced in CRM2013 is a nice feature that allows a user to upload a 144 by 144 pixel image to a record by clicking on the square silhouette to the left of the record name. While this may be useful for contacts and products, it doesn’t really make too much sense for more ‘inanimate’ entities such as cases. The CRM2013 SDK allows the image field to be set programmatically so with this in mind, we created a new custom workflow activity that can be found in our Workflow Essentials solution for CRM2013 (called DataFunctions.SetImage) which allows the user to update the image field in a workflow using an image web resource.

Here is an example of a synchronous workflow which evaluates the severity field on the case then sets the image to either a red no1 or a green no2 (NOTE: the synchronous workflow is configured to fire AFTER change of the severity field);

 

The custom workflow step allows the selection of an image web resource.

In action, here we see that by changing the 'Severity' field to have a value of 'Severity 1' the synchronous workflow sets the image to be a red no1.

 

Severity 2 displays a green no2.

 

The final component to make this update immediately is a simple jscript function triggered onchange of the Severity field that forces the form to refresh. Unfortunately, at the time of writing there is no supported way to refresh the part of the form which includes the image and business process flow. The following script does appear to work in all browsers however;

function ReLoadForm()

{

Mscrm.ReadFormUtilities.openInSameFrame(window._etc, Xrm.Page.data.entity.getId());

}

 

The above can provide a nice visual enhancement for the end user but make sure for those CRMOnline environments where storage is at a premium that you keep your image web resources as small as possible.