Sunday 27 March 2011

Getting Web Resources from the CRM 2011 Ribbon

If your creating a custom action/ribbon feature and you want to reference a file in your webresources, then adding the $websresource variable will allow for this.
e.g and image location could be


<Button
Id="B_TextButton"
LabelText="Send TXT"
ToolTipTitle="Send a TXT Message"
ToolTipDescription="Send a TXT message to this entity record, if the mobile number is provided"
TemplateAlias="o1"
Image16by16= "$webresource:new_txt16.png"
Image32by32="$webresource:new_txt32.png"/>


</CommandUIDefinition>

2 comments:

  1. Hi,
    There'll be an error if you use the extension as well when specifying the image resource (that is you should remove '.png'). You need only use the name of the resource.

    Thank you for the snippet :)
    Florin

    ReplyDelete
    Replies
    1. Thanks florin,need to get bloggin again :) This was early days on CRM 2011, the above certainly worked. I might have named the image incorrectly(adding a .png or something) but it certainly did work. Glad it helped abit!

      Delete