Hi,
I would like to hide/show ribbon buttons based on a lookup field in my form.
My condition is If the lookup has a value of "Checked In" than button should not display otherwise it should display.
Thanks
Hi,
I would like to hide/show ribbon buttons based on a lookup field in my form.
My condition is If the lookup has a value of "Checked In" than button should not display otherwise it should display.
Thanks
I did a test using Value Rule with lookup field value set to GUID and also name but its not working . So use CustomRule and try with above shared code.
Hi,
I would recommend to go for JS rule , where get the lookup text and return true/false. Here is the code -
function RibbonShowHideButton() { var returnResult = false; var statusObj = Xrm.Page.getAttribute("taqi_checkoutstatus").getValue(); var statusVal = null; if (statusObj != null) { statusVal = statusObj[0].name; if (statusVal.toLowerCase() == "checked in") { returResult = true; } } return returnResult; }
Hi Thank you for your reply.
I have tried setting enable rule, but either the doesn't show at all or it shows all the time.
I have added valueRule in Enable Rules please refer screenshot
taqi_checkoutstatus is the lookup name, it has two values Checked In & Checked Out
I have also assigned this Enable Rule to Command and Command to Button.
Please Help.
Hi,
Use ribbon workbench enable rule or display rule.
[View:https://m.youtube.com/watch?v=wUiqaR9TruU]
[View:https://balugajjala.wordpress.com/2017/01/27/enabledisable-a-ribbon-button-dynamically-based-on-a-form-value]
[View:http://www.powerxrm.com/how-to-dynamically-enabledisable-ribbon-buttons-based-on-field-values/]
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156