CRM 2013 introduced a new type of entity attribute called an “Entity Image”. Once an entity is configured to show an image, each entity record can have at most one image associated with the record, to be displayed on the top left corner next to the title of the record.

If we wish to change the image dynamically using JavaScript, here’s how…

The CRM 2013 SDK states that jQuery in form scripts and ribbon commands is not recommended. So how do I RETRIEVE (or create, update, delete) attribute values for a related record using JavaScript? It turns out that using Ajax and the OData endpoint to manipulate the XMLHttpRequest object is the key.

In addition, I shall make use of several new XRM methods, including “Save”, “alertDialog” and “getClientUrl” method. So, here we go!