serving the solutions day and night

Pages

Showing posts with label EnableRule. Show all posts
Showing posts with label EnableRule. Show all posts

Saturday, May 17, 2014

MS Dynamics CRM - Change Grid view background color

My client wants to change the grid view color based on the contact entity address type value is "Ship To". So i added a button in the contact entity "<ribbondiffxml>", but i didn't make it display, you can see there is no command in the "<displayrules>". I added new <customrule> to call the javascript("dns_contact") function ("BackGroundColorGrid") to change the color. Make sure you added jquery in your webresources.

Same way you can change color for the grid.



Friday, August 30, 2013

MS Dynamics CRM 2011 - EnableRule, ValueRule, OrRule & CustomRule in Ribbon Customizations

ValueRule - Enable the Custom button only when a specific filed on the form has a value.
For example, if the 'Email' field has value then the custom will be enable otherwise it will disable.

/RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/

<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
    <ValueRule Field="email" Value="null" InvertResult="true"/>
</EnableRule>

EnableRule for mulitple fields, use 'OrRule', for example

<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
    <OrRule>
        <Or>
            <ValueRule Field="email" Value="null" InvertResult="true"/>
        </Or>
        <Or>
              <ValueRule Field="leadsourcecode" Value="810520005"/>
        </Or>
    </OrRule>
</EnableRule>
           
EnableRule only works with Equal(=) condition, for different conditions (not equal) use 'InvertResult' attribute.

Refer the above id in the following location /RibbonDiffXml/CommandDefinitions/CommandDefinition/EnableRules

<EnableRule Id="Sample.account.form.CheckFaxValue.EnableRule"/>

CustomRule - call a javascript function based on the result.

<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
  <CustomRule FunctionName="DisableReportButton" Library="$webresource:dns_JavaScript/reports.js" Default="true" />
</EnableRule>

http://msdn.microsoft.com/en-us/library/gg334317.aspx
http://msdn.microsoft.com/en-us/library/gg328073.aspx
http://msdn.microsoft.com/en-us/library/gg309433.aspx

Friday, May 3, 2013

Customize the CRM Ribbon

Ribbon used to perform actions and add custom controls.
Displays actions that are relevant to each area of the application as users access them.
Dynamics CRM provides RibbonDiffXml definitions for all ribbons in the application for you to customize.
You can access the default ribbon definitions in the SDK\SampleCode\CS\Client\Ribbon\ExportRibbonXml\ExportedRibbonXml folder - this will generate all the entities ribbons

<RibbonDiffXml>
    <CustomActions>
        <CustomAction Id="Mscrm.DashboardTab.Favorite.CustomAction" Location="Mscrm.DashboardTab.Groups._children" Sequence="101">
            <CommandUIDefinition>
                <MaxSize Id="Mscrm.DashboardTab.Favorite.MaxSize" GroupId="Mscrm.DashboardTab.Favorite" Sequence="101" Size="LargeMedium" />
                <Scale Id="Mscrm.DashboardTab.Favorite.Scale.Popup" GroupId="Mscrm.DashboardTab.Favorite" Sequence="3001" Size="Popup" />
                <Group Id="Dns.DashboardTab.Favorite" Command="Mscrm.Enabled" Template="Mscrm.Templates.Flexible2" Sequence="100" Title="$LocLabels:Mscrm.DashboardTab.Favorite.TitleText" Description="$LocLabels:Mscrm.DashboardTab.Favorite.DescriptionText">
                    <Controls Id="Mscrm.DashboardTab.Favorite.Controls">
                        <Button Id="Mscrm.DashboardTab.Favorite.EmpApp" Command="Mscrm.DashboardTab.Favorite.EmpApp.Command" Sequence="201" ToolTipTitle="$LocLabels:Mscrm.DashboardTab.Favorite.EmpApp.LabelText" LabelText="$LocLabels:Mscrm.DashboardTab.Favorite.EmpApp.LabelText" ToolTipDescription="$LocLabels:Mscrm.DashboardTab.Favorite.EmpApp.Description" TemplateAlias="isv" />
                    </Controls>
                </Group>
                 <Tab Id="Mscrm.Isv.Global" Command="Mscrm.Isv.Global" Description="Place" Title="Place" Sequence="2000">
                    <Scaling Id="Mscrm.Isv.Global.Scaling">
                      <MaxSize/ />
                      <Scale/ />
                    </Scaling>
                    <Groups Id="Mscrm.Isv.Global.Groups">
                      <Group/>
                    </Groups>
                      </Tab>
            </CommandUIDefinition>
        </CustomAction>
        <HideCustomAction />
    </CustomActions>
    <Templates>
              <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
    </Templates>
     <CommandDefinitions />
     <RuleDefinitions />
</RibbonDiffXml>