Sunday, July 17, 2011

Gallery Feature to CRM 2011

One of the requirements that you may need to deal with is, when you develop public facing CRM web portal, showing gallery of images of products, equipment and so on. So how we can add gallery feature to web portal using out of the box CRM functionality? What about if used note section of an entity to attach the images? One of the limitations of note (annotation) entity is, it is not customizable entity. Why we need to customize the note entity? Because we need to identify the attached note images, which need to be displayed on web. Otherwise web portal shows attachments, which were added for other purposes by the user. Proposed solution to handle that situation is having intermediate entity to attach images.





Download Componant

Features of the solution

• Can be plugged this with any entity with 0 code changes.

Note: When you create one to many relationship between your entity and new_Gallery, you must name the lookup field name as "<publisher prefix><entity>id". Publisher Prefix has been set to “new_” in constant class.

• There is back end plugin to copy the images, which will be added to note section of Gallery entity, into the image folder of your web portal. Plugin will remove the image from the web portal, when you removed that image from the CRM note section.

Configuration for testing


• Import CRM solution, which is located at “..\CRM2011.Galleries\CRMSolution”
• Edit EntityName and EntityId properties of the control reference at default.aspx as required.
<uc3:viewgallery id="ctrlViewGallery" entityid="C21106C1-B491-E011-8551-0800270D5292" entityname="product" runat="server"></uc3:ViewGallery>
• Edit App setting values at web.config as required.
<add value="http://localhost" key="CRMServiceUrl"></add>
<add value="OrganizationName" key="CRMOrganizationName"></add>
• Edit below app setting value as required and then add it into the app setting section of web.config of CRM 2011
<add value="C:\ MyBlog\CRM2011.Galleries\images" key="WebPortalImagePath"></add>
• Deploy plugin “CRM2011.Galleries.Plugins” using solution located at CRM2011.Galleries.Plugins\Solution
• Set AppPool to run the web application with required credential to access CRM service.
• Give read write access level permission to CRMAppPool user for the image folder of the web portal.

Then you are good to go.

--Thushara Manchanayake--
http://dynamicscrmhelper.blogspot.com

No comments:

Post a Comment