Disable Sub Grid record buttons in ribbon based on Parent record’s value in CRM 2011.

Hi,

Recently we had a requirement to disable Add New and Edit button of a sub grid record based on parent record’s attribute value.

For this we first need to add a new EnableRule and pass the id of the parent record to a custom function that will use this value to get value of the form and pass true and false accordingly.

FirstPrimaryItemId CRMParameter will pass the id of the parent record.

<EnableRule Id="new.new_fcm_child.EnableRule2.EnableRule">
 <CustomRule FunctionName="DisableButton" Library="$webresource:new_myScript" Default="true">
 <CrmParameter Value="FirstPrimaryItemId" />
 </CustomRule>
 </EnableRule>

Adding this EnableRule to existing CommandDefinitions

<RibbonDiffXml>
 <CustomActions />
 <Templates>
 <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
 </Templates>
 <CommandDefinitions>
 <CommandDefinition Id="Mscrm.AddNewRecordFromSubGridStandard">
 <EnableRules>
 <EnableRule Id="Mscrm.AppendToPrimary" />
 <EnableRule Id="Mscrm.EntityFormIsEnabled" />
 <EnableRule Id="new.new_fcm_child.EnableRule2.EnableRule" />
 </EnableRules>
 <DisplayRules>
 <DisplayRule Id="Mscrm.ShowForOneToManyGrids" />
 <DisplayRule Id="Mscrm.AppendToPrimary" />
 <DisplayRule Id="Mscrm.CreateSelectedEntityPermission" />
 <DisplayRule Id="Mscrm.AppendSelected" />
 <DisplayRule Id="Mscrm.HideAddNewForChildEntities" />
 </DisplayRules>
 <Actions>
 <JavaScriptFunction FunctionName="Mscrm.GridRibbonActions.addNewFromSubGridStandard" Library="/_static/_common/scripts/RibbonActions.js">
 <CrmParameter Value="SelectedEntityTypeCode" />
 <CrmParameter Value="PrimaryEntityTypeCode" />
 <CrmParameter Value="FirstPrimaryItemId" />
 <CrmParameter Value="PrimaryControl" />
 </JavaScriptFunction>
 </Actions>
 </CommandDefinition>
 <CommandDefinition Id="Mscrm.EditSelectedRecord">
 <EnableRules>
 <EnableRule Id="Mscrm.CheckBulkEditSupportForEntity" />
 <EnableRule Id="Mscrm.VisualizationPaneNotMaximized" />
 <EnableRule Id="new.new_fcm_child.EnableRule2.EnableRule" />
 </EnableRules>
 <DisplayRules>
 <DisplayRule Id="Mscrm.BulkEditPrivilege" />
 <DisplayRule Id="Mscrm.WriteSelectedEntityPermission" />
 </DisplayRules>
 <Actions>
 <JavaScriptFunction FunctionName="Mscrm.GridRibbonActions.bulkEdit" Library="/_static/_common/scripts/RibbonActions.js">
 <CrmParameter Value="SelectedControl" />
 <CrmParameter Value="SelectedControlSelectedItemReferences" />
 <CrmParameter Value="SelectedEntityTypeCode" />
 </JavaScriptFunction>
 </Actions>
 </CommandDefinition>
 </CommandDefinitions>
 <RuleDefinitions>
 <TabDisplayRules />
 <DisplayRules>
 <DisplayRule Id="Mscrm.AppendSelected">
 <EntityPrivilegeRule PrivilegeType="Append" PrivilegeDepth="Basic" AppliesTo="SelectedEntity" />
 </DisplayRule>
 <DisplayRule Id="Mscrm.AppendToPrimary">
 <EntityPrivilegeRule PrivilegeType="AppendTo" PrivilegeDepth="Basic" AppliesTo="PrimaryEntity" />
 </DisplayRule>
 <DisplayRule Id="Mscrm.BulkEditPrivilege">
 <MiscellaneousPrivilegeRule PrivilegeName="BulkEdit" />
 </DisplayRule>
 <DisplayRule Id="Mscrm.CreateSelectedEntityPermission">
 <EntityPrivilegeRule PrivilegeType="Create" PrivilegeDepth="Basic" AppliesTo="SelectedEntity" />
 </DisplayRule>
 <DisplayRule Id="Mscrm.HideAddNewForChildEntities">
 <OrRule>
 <Or>
 <EntityPropertyRule AppliesTo="SelectedEntity" PropertyName="IsChildEntity" PropertyValue="false" />
 </Or>
 <Or>
 <RelationshipTypeRule AppliesTo="SelectedEntity" AllowCustomRelationship="false" />
 </Or>
 </OrRule>
 </DisplayRule>
 <DisplayRule Id="Mscrm.ShowForOneToManyGrids">
 <RelationshipTypeRule AppliesTo="SelectedEntity" RelationshipType="OneToMany" />
 </DisplayRule>
 <DisplayRule Id="Mscrm.WriteSelectedEntityPermission">
 <EntityPrivilegeRule PrivilegeType="Write" PrivilegeDepth="Basic" AppliesTo="SelectedEntity" />
 </DisplayRule>
 </DisplayRules>
 <EnableRules>
 <EnableRule Id="new.new_fcm_child.EnableRule2.EnableRule">
 <CustomRule FunctionName="DisableButton" Library="$webresource:new_Service_Request_Script" Default="true">
 <CrmParameter Value="FirstPrimaryItemId" />
 </CustomRule>
 </EnableRule>
 <EnableRule Id="Mscrm.AppendToPrimary">
 <RecordPrivilegeRule PrivilegeType="AppendTo" AppliesTo="PrimaryEntity" />
 </EnableRule>
 <EnableRule Id="Mscrm.CheckBulkEditSupportForEntity">
 <OrRule>
 <Or>
 <SelectionCountRule AppliesTo="SelectedEntity" Minimum="1" Maximum="1" />
 </Or>
 <Or>
 <SelectionCountRule AppliesTo="SelectedEntity" Minimum="2" />
 <CustomRule FunctionName="Mscrm.RibbonActions.isBulkEditEnabledForEntity" Library="/_static/_common/scripts/RibbonActions.js">
 <CrmParameter Value="SelectedEntityTypeCode" />
 </CustomRule>
 </Or>
 </OrRule>
 </EnableRule>
 <EnableRule Id="Mscrm.EntityFormIsEnabled">
 <FormStateRule State="Disabled" InvertResult="true" />
 </EnableRule>
 <EnableRule Id="Mscrm.VisualizationPaneNotMaximized">
 <CustomRule FunctionName="Mscrm.RibbonActions.disableButtonsWhenChartMaximized" Library="/_static/_common/scripts/RibbonActions.js">
 <CrmParameter Value="SelectedControl" />
 </CustomRule>
 </EnableRule>
 </EnableRules>
 </RuleDefinitions>
 <LocLabels />
</RibbonDiffXml>

The JavaScript code

// function to disable related record
 function DisableButton(id) {

 //CRM Server Url:
 var result = true;
 var serverUrl = Xrm.Page.context.getServerUrl();

// OData Call to get the data
 var ServiceRequestQuery = "new_CustomEntitySet?$select=attr1,attr2&$filter=attrId eq guid'" + id + "'";
 var ServiceRequestUrl = serverUrl + "/XRMServices/2011/OrganizationData.svc/" + ServiceRequestQuery;
 // make synchronous call
 var ServiceRequest= syncODataCall(ServiceRequestUrl);
 // get the option set value
 if (ServiceRequest[0].attr1 != null && ServiceRequest[0].attr2 != null) {
 var attr1Value = ServiceRequest[0].attr1.Value;
 var attr2Value = ServiceRequest[0].attr2 .Value;

if (attr1Value != "863600004" && attr2Value == "279640002") {
 result = false;
 }
 else {
 result = true;
 }
 }
 return result;
 }

// function to make synchronous oData call
 function syncODataCall(odataSelect) {
 var request = new XMLHttpRequest();
 request.open("GET", odataSelect, false);
 request.setRequestHeader("Accept", "application/json");
 request.setRequestHeader("Content-Type", "application/json; charset=utf-8");
 request.send();
 var objJQuery = JSON.parse(request.responseText);
 return objJQuery.d.results;
 }

Hope it helps

Using RetrieveEntityRibbonRequest to get the ribbon definition of an Entity

Hi,

Recently I was assigned a task to find out programmatically if a particular button is already defined on an entity or not. For this we can make use RetrieveEntityRibbonRequest class.

Sample C# Code


// Initialize RetrieveEntityRibbonRequest
RetrieveEntityRibbonRequest ribbonReq = new RetrieveEntityRibbonRequest();

// RibbonLocationFilters

// All - Retrieve all Ribbons. Equivalent to Default. Value = 7.
// Default - Retrieve all Ribbons. Equivalent to All. Value = 7.
// Form - Retrieve just the form ribbon. Value = 1.
// HomepageGrid -  Retrieve just the ribbon displayed for entity grids. Value = 2.
// SubGrid -  Retrieve just the ribbon displayed when the entity is displayed in a subgrid or associated view. Value = 4.
// if not specified it returns only the definition
ribbonReq.RibbonLocationFilter = RibbonLocationFilters.All;

// specify the entity schema name
ribbonReq.EntityName = currentEntityName;
RetrieveEntityRibbonResponse ribbonRes = (RetrieveEntityRibbonResponse)_serviceProxy.Execute(ribbonReq);
Byte[] bytes = unzipRibbon(ribbonRes.CompressedEntityXml);
string ribbonDiffString = System.Text.Encoding.GetEncoding("utf-8").GetString(bytes);
if (ribbonDiffString.Contains("RibbonButtonID"))
{
// logic
}

public byte[] unzipRibbon(byte[] data)
{
System.IO.Packaging.ZipPackage package = null;
MemoryStream memStream = null;
memStream = new MemoryStream();
memStream.Write(data, 0, data.Length);
package = (ZipPackage)ZipPackage.Open(memStream, FileMode.Open);
ZipPackagePart part = (ZipPackagePart)package.GetPart(new Uri("/RibbonXml.xml", UriKind.Relative));
using (Stream strm = part.GetStream())
{
long len = strm.Length;
byte[] buff = new byte[len];
strm.Read(buff, 0, (int)len);
return buff;
}
}

Bye.

Using multiple JavaScriptFunction for Actions in CRM 2011 Ribbon.

Hi,

We had a requirement in which we wanted to add some functionality on the existing Distribute Campaign Activity button for Campaign Activity entity.

For e.g. before we start the distribution we wanted to check for a specific value for all the Marketing Lists associated to that Campaign Activity. Based on it we wanted to proceed further or stop the distribution.

So we created a new custom button using the same definitions used for the existing Distribute Campaign Activity button (i.e. same CommandDefinitions and RuleDefinitions). The only thing we added was the new JavaScriptFunction in the Actions menu. It was referring to the function name CheckMLUA inside the webresource name new_CheckML

Now inside this new JavaScriptFunction we wanted to call the CallDistribute function that is being used by the OOB Distribute Campaign Activity button

For this to work we defined the FunctionName as isNAN for campaignactivity.js.

“For each library, add a <JavaScriptFunction Library=”$webresource:webresourceName” FunctionName=”isNaN” /> node. It requires a function name, so we’ve just been putting isNaN in there so there’s no error.”

<JavaScriptFunction
Library=$webresource:new_CheckML
FunctionName=CheckMLUA />

<JavaScriptFunction
FunctionName=isNaN
Library=/_static/ma/campaignactivity/campaignactivity.js>

<CrmParameter
Value=PrimaryEntityTypeCode />

</JavaScriptFunction>

And our function

RibbonDiffXML

</pre>
<RibbonDiffXml>
 <CustomActions>
 <CustomAction Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.CustomAction" Location="Mscrm.Form.campaignactivity.MainTab.Actions.Controls._children" Sequence="41">
 <CommandUIDefinition>
 <Button Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute" Command="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command" Sequence="0" ToolTipTitle="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText" LabelText="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText" ToolTipDescription="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.Description" TemplateAlias="o1" Image16by16="/_imgs/MA/CampaignActivityDistribute_16.png" Image32by32="/_imgs/MA/CampaignActivityDistribute_32.png" />
 </CommandUIDefinition>
 </CustomAction>
 </CustomActions>
 <Templates>
 <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
 </Templates>
 <CommandDefinitions>
 <CommandDefinition Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command">
 <EnableRules>
 <EnableRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.EnableRule.FormStateRule" />
 </EnableRules>
 <DisplayRules>
 <DisplayRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.DisplayRule.EntityPrivilegeRule" />
 </DisplayRules>
 <Actions>
 <JavaScriptFunction Library="$webresource:new_CheckML" FunctionName="CheckMLUA" />
 <JavaScriptFunction FunctionName="isNaN" Library="/_static/ma/campaignactivity/campaignactivity.js">
 <CrmParameter Value="PrimaryEntityTypeCode" />
 </JavaScriptFunction>
 </Actions>
 </CommandDefinition>
 </CommandDefinitions>
 <RuleDefinitions>
 <TabDisplayRules />
 <DisplayRules>
 <DisplayRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.DisplayRule.EntityPrivilegeRule">
 <EntityPrivilegeRule EntityName="activitypointer" PrivilegeDepth="Basic" PrivilegeType="Create" />
 </DisplayRule>
 </DisplayRules>
 <EnableRules>
 <EnableRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.EnableRule.FormStateRule">
 <FormStateRule State="Existing" />
 </EnableRule>
 </EnableRules>
 </RuleDefinitions>
 <LocLabels>
 <LocLabel Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Description">
 <Titles>
 <Title languagecode="1033" description="Distribute Description" />
 </Titles>
 </LocLabel>
 <LocLabel Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText">
 <Titles>
 <Title languagecode="1033" description="Distribute" />
 </Titles>
 </LocLabel>
 </LocLabels>
 </RibbonDiffXml>
<pre>

The helpful links

http://rajeevpentyala.wordpress.com/2012/05/23/loading-dependent-jscript-libraries-in-ribbon-buttons-execution-crm-2011/

http://social.microsoft.com/Forums/is/crmdevelopment/thread/02ed3c05-05c2-4638-a139-e070db4561b0

Bye.

Try out – Ribbon Workbench for Dynamics CRM 2011

Hi,

Today i came across this new tool for Ribbon editing in CRM 2011.

http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx

The tools looks really wonderful.

Will try it out soon.

Bye.

 

 

Filtered lookup for n:n relationship.

Hi,

Daniel Cai has recently posted about his solution for filtered lookup in case of n:n relationship in his blog.

It works like a charm.

Do check it out.

http://danielcai.blogspot.com/2011/12/filtered-lookup-for-existing-button-of.html

Bye.

The best Ribbon Editor Tool for CRM 2011.

Hi,

Just a few days back came to know from my friend that a new ribbon editor tool was has been released.

http://erikpool.blogspot.com/2011/10/new-crm-2011-ribbon-editing-tool.html

So thought of giving it a try.

After using it for few days I can easily say that this is exactly the tool many of us would have been waiting for ribbon editing.

There are other posts as well in the Erik Pool’s blog for understanding how exactly ribbon can be customized. Do have a look at them.

http://erikpool.blogspot.com/2011/10/understanding-crm-ribbon-xml-part-3.html

Bye.

Using ValueRule to hide “Add New” Button for an entity’s subgrid in CRM 2011

Hi,

Suppose we have to disable “Add New related record” button for a SubGrid of a custom entity A. The condition is that it should get disabled based on the value of one of the option set in the form (of Custom entity B) to which it is associated with.

AddNewStandard button is the one which we need to refer to do that.

In the ValueRule  new_approvalstatus field is an optionset with the corresponding value (2233770000) for which we want to disable the button in the ribbon.

We can use the below RibbonDiffXml to achieve that.

   <RibbonDiffXml>
        <CustomActions>
          <CustomAction Id="MyOrg_CustomAction" Location="Mscrm.SubGrid.new_promotiondefinition.AddNewStandard">
            <CommandUIDefinition>
              <Button Id="Mscrm.SubGrid.new_promotiondefinition.AddNewStandard" Command="MyOrg_Command" Sequence="20"
LabelText="$Resources(EntityDisplayName):Ribbon.SubGrid.AddNew" Alt="$Resources(EntityDisplayName):Ribbon.SubGrid.AddNew" Image16by16="/_imgs/ribbon/NewRecord_16.png" Image32by32="/_imgs/ribbon/newrecord32.png" TemplateAlias="o1" ToolTipTitle="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddNewStandard_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddNewStandard_ToolTipDescription" />
            </CommandUIDefinition>
          </CustomAction>
          <HideCustomAction Location="Mscrm.SubGrid.new_promotiondefinition.AddExistingStandard" HideActionId="Mscrm.SubGrid.new_promotiondefinition.AddExistingStandard.HideAction" />
        </CustomActions>
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="MyOrg_Command">
            <EnableRules>
              <EnableRule Id="MyOrg_CustomEnableRule" />
            </EnableRules>
            <DisplayRules></DisplayRules>
            <Actions></Actions>
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules />
          <EnableRules>
            <EnableRule Id="MyOrg_CustomEnableRule">
              <ValueRule Default="true"  Field="new_approvalstatus" InvertResult="true" Value="223770000"/>
            </EnableRule>
          </EnableRules>
        </RuleDefinitions>
        <LocLabels />
      </RibbonDiffXml>

The thing to remember is that it will override the existing command definition and the rules and actions defined in it. So here we would need to copy those displayrules, enablerules and actions if we want those functionality.

Hope it helps.

Account Search based on account name through a ribbon button on account grid in CRM 2011

Hi,

Just created a simple managed solution that will show a button on Account’s grid. It will only get enabled when only one record is selected in grid otherwise it would remain disabled.

For that we can use SelectionCountRule in our EnableRule definition.

On click of button we are calling a JavaScript function and passing guid of the record selected using CrmParameter as the part of JavaScriptFunction Action.

The JavaScript function uses that guid, makes a OData call and retrieves the account name and passes that account name as a query parameter to google search url and uses window.open method to open the page.

RibbonDiffXml for that:-

<RibbonDiffXml>
        <CustomActions>
          <CustomAction Id="MyOrg.CustomAction" Location="Mscrm.HomepageGrid.account.MainTab.Collaborate.Controls._children" Sequence="1">
            <CommandUIDefinition>
              <Button Id="MyOrg.Button" ToolTipTitle="Search in Google" ToolTipDescription="Search detail of the account selected" Command="MyOrg.Command" Sequence="1" LabelText="Search in Google" Alt="Search in Google" Image16by16="$webresource:new_search16" Image32by32="$webresource:new_search32" TemplateAlias="o1" />
            </CommandUIDefinition>
          </CustomAction>
        </CustomActions>
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="MyOrg.Command">
            <EnableRules>
              <EnableRule Id="MyOrg.EnableRule"></EnableRule>
            </EnableRules>
            <DisplayRules />
            <Actions>
              <JavaScriptFunction Library="$webresource:new_search" FunctionName="search">
                <StringParameter Value="Guid Selected"></StringParameter>
                <CrmParameter Value="SelectedControlSelectedItemIds"></CrmParameter>
              </JavaScriptFunction>
            </Actions>
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules />
          <EnableRules>
            <EnableRule Id="MyOrg.EnableRule">
              <SelectionCountRule AppliesTo="SelectedEntity" Maximum="1" Minimum="1"></SelectionCountRule>
            </EnableRule>
          </EnableRules>
        </RuleDefinitions>
        <LocLabels />
 </RibbonDiffXml>
 

JavaScript:-

function search(message,value)
{
var  Id = value;
var serverUrl = Xrm.Page.context.getServerUrl();
var ODataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";

var retrieveAccountReq = new XMLHttpRequest();
retrieveAccountReq.open("GET", ODataPath + "/AccountSet(guid'" + Id + "')", false);
retrieveAccountReq.setRequestHeader("Accept", "application/json");
retrieveAccountReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");

retrieveAccountReq.onreadystatechange = function () {
  retrieveAccountReqCallBack(this);
 };

retrieveAccountReq.send();
}

function retrieveAccountReqCallBack(retrieveAccountReq) {

  if (retrieveAccountReq.readyState == 4) {
  if (retrieveAccountReq.status == 200) {

 var accountName = eval('('+retrieveAccountReq.responseText+')').d.Name;
 window.open("http://www.google.com/search?q="+accountName);
}
  else {
     alert("Call Failed.");
  }
 }
}

The managed solution:-

https://nishantrana.files.wordpress.com/2011/10/accountsearch_1_0_0_0_managed.doc

Just change the extension to zip from doc.

Hope it helps!

 

Custom Ribbon Button to get the Guid of the record in CRM 2011

Update :- Works for CRM 2013 as well.

Hi,

Normally to get the guid we need to click on “Copy a link” button and then get id from the url, so just thought of creating a custom button that only copies the guid.

Clicking on Get Guid button will copy the id to the clipboard

RibbonDiffXml:-

 <RibbonDiffXml>
    <CustomActions>
      <CustomAction Id="Sample.all.form.GetGuid.CustomAction"
                    Location="Mscrm.Form.{!EntityLogicalName}.MainTab.Collaborate.Controls._children"
                    Sequence="75">
        <CommandUIDefinition>
          <Button Id="Sample.{!EntityLogicalName}.form.GetGuid.Button"
                  Command="Sample.form.GetGuid"
                  Sequence="61"
                  LabelText="$LocLabels:Sample.all.GetGuid.LabelText"
                  ToolTipTitle="$LocLabels:Sample.all.GetGuid.LabelText"
                  ToolTipDescription="$LocLabels:Sample.all.GetGuid.ToolTip"
                  TemplateAlias="o2"
                  Image16by16="/_imgs/ribbon/copyshortcut16.png"
                  Image32by32="/_imgs/ribbon/copyshortcut32.png" />
        </CommandUIDefinition>
      </CustomAction>
    </CustomActions>
    <Templates>
      <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
    </Templates>
    <CommandDefinitions>
      <CommandDefinition Id="Sample.form.GetGuid">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="getGuid"
                              Library="$webresource:new_formActions" >
            <CrmParameter Value="FirstPrimaryItemId" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
    </CommandDefinitions>
    <RuleDefinitions>
      <TabDisplayRules />
      <DisplayRules />
      <EnableRules />
    </RuleDefinitions>
    <LocLabels>
      <LocLabel Id="Sample.all.GetGuid.LabelText">
        <Titles>
          <Title languagecode="1033" description="Get Guid" />
        </Titles>
      </LocLabel>
      <LocLabel Id="Sample.all.GetGuid.ToolTip">
        <Titles>
          <Title languagecode="1033" description="Get the guid of the current record." />
        </Titles>
      </LocLabel>
    </LocLabels>
  </RibbonDiffXml>

Download the managed solution here ( Change the extension to zip from doc).

https://nishantrana.files.wordpress.com/2011/10/getguidapplicationribbon_1_0_0_0_managed.doc

Hope it helps.

Adding the existing Add Notes button to Actions Tab for Incident Entity Ribbon in CRM 2011

We had a requirement to add the Add Note button to Actions tab for incident entity.

Location="Mscrm.Form.incident.MainTab.Actions.Controls._children"
Defines the location where we want to add the Add Notes button.

Below is the RibbonDiffXml we used to achieve that.

<RibbonDiffXml>
<CustomActions>
<CustomAction Id="MoveAddNoteCustomAction" Location="Mscrm.Form.incident.MainTab.Actions.Controls._children" Sequence="1">
<CommandUIDefinition>
<Button Id="Mscrm.Form.incident.AddNote" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Document_AddNote_ToolTipTitle"
Sequence="1"
ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddNote" Command="Mscrm.AddNoteToPrimaryRecord"
LabelText="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" Alt="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote"
Image16by16="/_imgs/ribbon/AddNote_16.png" Image32by32="/_imgs/ribbon/noteyellowadd32.png" TemplateAlias="o1" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions />
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels />
</RibbonDiffXml>

Hope it helps.