CRM 2011 – Displaying images for a contact

A quick blog post to point you in the direction of a couple of exellent tools to display images in for a contact (or other entities).

The timing of this was a day too late (for me) because I had written a basic way to display images yesterday and then today I find the solution today and it works better than mine because you can have multiple images and it resizes the images in a neat way, working out the aspect ratio from the available space.

Both solutions use the method of uploading picture files as a note for the contact and then display these.

For the html, jquery method then go to this blog and you can download the solution file

http://mscrmblogger.com/2012/03/31/imagebrowser-webresource/

You will need to add the image img_browser.html as a webresource onto your page.  This is very useful because I think (I haven’t tried it) use this to display images on other entities.

The MSCRM blogger team have also created a silverlight version, well actually they created that first, you can get that here

http://crmattachmentimage.codeplex.com/

A great contribution to the CRM community and will save everyone writing the same solution over and over.

Advertisements

One thought on “CRM 2011 – Displaying images for a contact

  1. Isuru Jayarathna February 27, 2013 / 6:35 am

    Hi, If anyone wondering how to fix the “400: Bad Request Error” on http://mscrmblogger.com/2012/03/31/imagebrowser-webresource/ here is how.

    01. Download the Unmanaged Solution
    02. Extract the contents to a folder.
    03. Open up img_browserhtml80C73713-D579-E111-B980-1CC1DEE89AD5 file using a notepad
    04. Change the following code segment

    ============================
    getImage();
    }

    return {
    EntityId: parent.Xrm.Page.data.entity.getId(),
    EntityName: parent.Xrm.Page.data.entity.getEntityName(),
    First: true,
    MaxHeight: 0,
    MaxWidth: 0,
    Last: false,
    Index: 0,
    Previous: previous,
    Next: next,
    Initialize: init
    };

    =================== To this as bellow===========================

    getImage();
    }

    var entityid=parent.Xrm.Page.data.entity.getId();

    if(entityid==null)
    entityid=”{80C73713-D579-E111-B980-1CC1DEE89AD5}”; // some random id that doesn’t exists in CRM.

    return {
    EntityId: entityid,
    EntityName: parent.Xrm.Page.data.entity.getEntityName(),
    First: true,
    MaxHeight: 0,
    MaxWidth: 0,
    Last: false,
    Index: 0,
    Previous: previous,
    Next: next,
    Initialize: init
    };
    }();

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s