Answered by:
CRM 2011: Remove a ribbon button in specific entity

Question
-
Hi guys,
I can show a button in a context menu for a specific entity using FormEntityContextRule like this:
<DisplayRule Id="Id.Show">
<FormEntityContextRule Default="0" EntityName="new_test" />
</DisplayRule>
What I want now is: a ribbon button is shown for all entities except 1 specific entity.
Can I do it with a simple move like:
<FormEntityContextRule Default="0" EntityName="!new_test" /> Or <FormEntityContextRule Default="0" EntityName="!{new_test}" /> ?
Thanks in advanced.
Monday, September 5, 2011 7:10 AM
Answers
-
Even if Jehanzeb made a little mistake, it seems to be the good answer
<FormEntityContextRule EntityName="new_test" InvertResult="true" />
Removed the "!" character in EntityName
My blog : http://mscrmtools.blogspot.com
All my tools for Dynamics CRM 4.0 on my dedicated site: MSCRMTools Repository
Upgraded tools for Dynamics CRM 2011!
View Layout Replicator for Microsoft Dynamics CRM 2011
Searchable Property Updater for Microsoft Dynamics CRM 2011
Ribbon Browser for Microsoft Dynamics CRM 2011
SiteMap Editor for Microsoft Dynamics CRM 2011
JavaScript Web Resource Manager for Microsoft Dynamics CRM 2011- Marked as answer by Linh Giang Tuesday, September 6, 2011 2:51 AM
Monday, September 5, 2011 1:39 PMModerator
All replies
-
Hi,
The system is expecting an entity name in paramter EnityName and it will consider !new_test as entity name and will not work. You may also refer the schema of : http://msdn.microsoft.com/en-us/library/gg328247.aspx
You can try this:
<FormEntityContextRule EntityName="!new_test" InvertResult="true" />
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".- Proposed as answer by Tanguy T [MVP CRM]MVP, Moderator Monday, September 5, 2011 1:39 PM
Monday, September 5, 2011 7:57 AM -
Even if Jehanzeb made a little mistake, it seems to be the good answer
<FormEntityContextRule EntityName="new_test" InvertResult="true" />
Removed the "!" character in EntityName
My blog : http://mscrmtools.blogspot.com
All my tools for Dynamics CRM 4.0 on my dedicated site: MSCRMTools Repository
Upgraded tools for Dynamics CRM 2011!
View Layout Replicator for Microsoft Dynamics CRM 2011
Searchable Property Updater for Microsoft Dynamics CRM 2011
Ribbon Browser for Microsoft Dynamics CRM 2011
SiteMap Editor for Microsoft Dynamics CRM 2011
JavaScript Web Resource Manager for Microsoft Dynamics CRM 2011- Marked as answer by Linh Giang Tuesday, September 6, 2011 2:51 AM
Monday, September 5, 2011 1:39 PMModerator -
Hi,
Thank for your help, now I pay attention more on InvertResult value :D.
Anyway, can you tell me how to post the code with formatted color? I copy my code from Notepad++, but it doesn't bring formatted color with it.
Thanks
- Edited by Linh Giang Tuesday, September 6, 2011 3:02 AM
Tuesday, September 6, 2011 2:51 AM