Answered by:
hide mark complete ribbon menu

Question
-
hello i want to hide the mark complete ribbon menu button when selected lookup value is "waiting"
i dont know how to do it by using javascript?
thx...
Software Specialist CrmThursday, November 17, 2011 2:39 PM
Answers
-
Hi,
You will need to do two things to achive this scenario
1. You will have to override the CommandDefinition of the out of box mark as complete button. to do this, either you can hide the existing button and create your own button with the same command definition but updated Enable Rule or create a new command definition with the same id as the out of box one. The enable Rule has to define a custom enable rule which checks the status "waiting"
2. The ribbon content will evalute the custom enable rule when a record is selected in the grid. In order to force the ribbon to refresh when another record is selected, you will need a javascript which forces ribbon refresh
Xrm.Page.ui.refreshRibbon();
Thanks,- Marked as answer by DavidJennawayMVP, Moderator Wednesday, December 14, 2011 4:25 PM
Thursday, November 17, 2011 11:55 PM
All replies
-
Hi,
You will need to do two things to achive this scenario
1. You will have to override the CommandDefinition of the out of box mark as complete button. to do this, either you can hide the existing button and create your own button with the same command definition but updated Enable Rule or create a new command definition with the same id as the out of box one. The enable Rule has to define a custom enable rule which checks the status "waiting"
2. The ribbon content will evalute the custom enable rule when a record is selected in the grid. In order to force the ribbon to refresh when another record is selected, you will need a javascript which forces ribbon refresh
Xrm.Page.ui.refreshRibbon();
Thanks,- Marked as answer by DavidJennawayMVP, Moderator Wednesday, December 14, 2011 4:25 PM
Thursday, November 17, 2011 11:55 PM -
Hi,
You will need to do two things to achive this scenario
1. You will have to override the CommandDefinition of the out of box mark as complete button. to do this, either you can hide the existing button and create your own button with the same command definition but updated Enable Rule or create a new command definition with the same id as the out of box one. The enable Rule has to define a custom enable rule which checks the status "waiting"
2. The ribbon content will evalute the custom enable rule when a record is selected in the grid. In order to force the ribbon to refresh when another record is selected, you will need a javascript which forces ribbon refresh
Xrm.Page.ui.refreshRibbon();
Thanks,
do you know any success article which explains step by step?I found some articles about that but they are not clear
Software Specialist Crm- Edited by Ahmet Çankaya Friday, November 18, 2011 8:38 AM
Friday, November 18, 2011 8:37 AM -
What do you meant by " button when selected lookup value is "waiting"?
For walk-through about how to write custom enable rule on OutofBox CRM Ribbon button see http://myencounterwithcrm.wordpress.com/2011/05/24/walkthrough-adding-customrule-to-outofbox-ribbon-button/
hth
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Contorol (Beta)- Edited by Makarand Keer Friday, November 18, 2011 9:34 AM
Friday, November 18, 2011 9:33 AM -
What do you meant by " button when selected lookup value is "waiting"?
For walk-through about how to write custom enable rule on OutofBox CRM Ribbon button see http://myencounterwithcrm.wordpress.com/2011/05/24/walkthrough-adding-customrule-to-outofbox-ribbon-button/
hth
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Contorol (Beta)
When i open the phonecall dialog window there is a ribbon which name is mark as complete
and i want to disable this ribbon when the lookup item attribute value is equal to="assign on me"
thx
Software Specialist CrmFriday, November 18, 2011 9:42 AM -
any idea?
Software Specialist CrmMonday, November 21, 2011 8:39 AM -
You can try using Ribbon EnableRule and Xrm.Page.ui.refreshRibbon()
<CommandDefinition> <EnableRules> <EnableRule Id="String" /> </EnableRules> </CommandDefinition>
Write a EnableRule on Ribbon Button that you want to control and Call Custom JavaScript using CustomRule. This JavaScript should read value of Lookup attribute and return True or False.On OnChange event of Lookup attribute call refreshRibbon button. Once Ribbon is refreshed it will execute JavaScript function and Enable / Disable Ribbon button
HTH
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)- Proposed as answer by Makarand Keer Wednesday, November 23, 2011 8:17 AM
Monday, November 21, 2011 9:06 AM -
You can try using Ribbon EnableRule and Xrm.Page.ui.refreshRibbon()
<CommandDefinition> <EnableRules> <EnableRule Id="String" /> </EnableRules> </CommandDefinition>
Write a EnableRule on Ribbon Button that you want to control and Call Custom JavaScript using CustomRule. This JavaScript should read value of Lookup attribute and return True or False.On OnChange event of Lookup attribute call refreshRibbon button. Once Ribbon is refreshed it will execute JavaScript function and Enable / Disable Ribbon button
HTH
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)
Software Specialist CrmMonday, November 21, 2011 9:41 AM -
Monday, November 21, 2011 3:21 PM
-
Refer MSDN http://msdn.microsoft.com/en-us/library/gg334682.aspx
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)I have found and examine this webpage but i need how to do it step by step bec i am beginner one in crm 2011
thx
Software Specialist CrmMonday, November 21, 2011 3:30 PM -
There are few examples in SDK Help. Also many examples on internet.
http://howto-mscrm.blogspot.com/2011/04/how-to-series-6-how-to-overrideenable.html
http://www.powerobjects.com/blog/2011/06/17/crm-2011-enabling-and-disabling-ribbon-buttons-2/
MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)- Proposed as answer by Makarand Keer Wednesday, November 23, 2011 8:17 AM
Monday, November 21, 2011 4:01 PM -
I think the best place to start is to read on how to customize the CRM Ribbon. The sdk has a very good walkthrough examples on how to create custom enable rules too
http://msdn.microsoft.com/en-us/library/gg309639.aspxMonday, November 21, 2011 7:34 PM