Wednesday, November 23, 2011

Adding New Group to CRM Form in CRM 2011

Hi Friends, Now I will walk through how to add a new group to an OOB entity.


Before Adding Custom Group to Account Entity

After Adding Custom Group to Account Enity

Follow the following steps
1. Export the solution to which we wants to customize
2. Open the Customizations.xml file in edit mode
3. Find "RibbonDiffXml" tag under Account entity
4. customize the "RibbonDiffXml" in the following way to add custom group to Entity Form

 <RibbonDiffXml>
        <CustomActions>
        <CustomAction Id="Sample.account.form.CustomGroup.CustomAction" Location="Mscrm.Form.account.MainTab.Groups._children" Sequence="110">
          <CommandUIDefinition>
            <Group Id="sample.account.form.CustomGroup.Group" Command="sample.account.form.CustomGroup.Command" Title="$LocLabels:sample.account.CustomGroup.Title" Sequence="38" Template="Mscrm.Templates.Flexible2" Image32by32Popup="$webresource:new_samplebutton32x32.png">
              <Controls Id="sample.account.form.CustomGroup.Controls">
                <Button Id="sample.account.form.CustomGroup.Button.A" Command="sample.account.CustomGroup.Button.A.Command" Sequence="20" LabelText="$LocLabels:sample.account.CustomGroup.Button.A.LabelText" ToolTipTitle="$LocLabels:sample.account.CustomGroup.Button.A.LabelText" ToolTipDescription="$LocLabels:sample.account.CustomGroup.Button.A.Description" TemplateAlias="o1" Image16by16="$webresource:new_samplebutton16x16.png" Image32by32="$webresource:new_samplebutton32x32.png" />              
              </Controls>
            </Group>
          </CommandUIDefinition>
        </CustomAction>
          <CustomAction Id="sample.account.form.CustomGroup.MaxSize.CustomAction" Location="Mscrm.Form.account.MainTab.Scaling._children" Sequence="120">
            <CommandUIDefinition>
              <MaxSize Id="sample.account.form.CustomGroup.MaxSize" GroupId="sample.account.form.CustomGroup.Group" Sequence="21" Size="LargeLarge" />
            </CommandUIDefinition>
          </CustomAction>      
        </CustomActions>
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="sample.account.CustomGroup.Button.A.Command">
            <EnableRules/>
            <DisplayRules>
              <DisplayRule Id="sample.account.form.DisplayRule.NotonCreate" />
            </DisplayRules>
            <Actions>
              <JavaScriptFunction Library="$webresource:new_sample.js" FunctionName="TestFunction"></JavaScriptFunction>
            </Actions>
          </CommandDefinition>
          <CommandDefinition Id="sample.account.form.CustomGroup.Command">
            <EnableRules/>
            <DisplayRules>
              <DisplayRule Id="sample.account.form.DisplayRule.NotonCreate" />
            </DisplayRules>
            <Actions />
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules>
            <DisplayRule Id="sample.account.form.DisplayRule.NotonCreate">          
              <FormStateRule State="Create" InvertResult="true" />
            </DisplayRule>
          </DisplayRules>
          <EnableRules />
        </RuleDefinitions>
        <LocLabels>
          <LocLabel Id="sample.account.CustomGroup.Button.A.Description">
            <Titles>
              <Title languagecode="1033" description="Custom Button Description" />
            </Titles>
          </LocLabel>
          <LocLabel Id="sample.account.CustomGroup.Button.A.LabelText">
            <Titles>
              <Title languagecode="1033" description="Custom Button" />
            </Titles>
          </LocLabel>        
          <LocLabel Id="sample.account.CustomGroup.Title">
            <Titles>
              <Title languagecode="1033" description="Custom Group" />
            </Titles>
          </LocLabel>
        </LocLabels>
      </RibbonDiffXml>



5. Now zip the solution and import back to CRM. you will find the custom Group on the Account Form.


Hope it helps!!!

No comments:

Post a Comment