Dynamics 365 (CRM) Image Loader

This article describes how to create a simple Dynamics 365 (CRM) web resource that would allow us to display images based on a dynamics URL. This URL would be stored in an entity attribute and the name of the attribute would passed as a parameter to the web resource.

Preparing the demo for EMEA Summit 2017, I needed to display some logos and organisations images (covers) in the Account entity.

Let me show you a picture and you will immediately get what I mean:

CRMUG_EMEA_Summit2017_ImageLoader_imagesAccountForm

In our demo, we used the account entity to track the different NGOs / charities that would be part of the end solution. Each charity would have their own different logo and image cover that would be, later on, displayed in the PowerApp we also prepared.

Those images would be defined based on the following account attributes:

CRMUG_EMEA_Summit2017_ImageLoader_imageAttributesAccountForm

Solution: A simple web resource that would allow us to specify the attribute name with the URL as a parameter.

Below you can see the form definition, which got 2 web resources to host those previous images:

CRMUG_EMEA_Summit2017_ImageLoader_accountForm_webresource

If we now look at the properties of each web resource, we would see they are using the same HTML web resource behind the scene, but the parameter we are passing is different. The parameter is actually the attribute name to feed the image:

CRMUG_EMEA_Summit2017_ImageLoader_webresource_logo_parameter

And the other one:

CRMUG_EMEA_Summit2017_ImageLoader_webresource_cover_parameter

If you want to see the code of that HTML web resource, have a look at my GitHub link.

Hope you find it useful 🙂

Advertisements

Posted on April 10, 2017, in CRM, CRM Online, Dynamics 365, JavaScript and tagged , . Bookmark the permalink. Leave a comment.

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

%d bloggers like this: