Notifications
Announcements
No record found.
I'm not able to solve my problem please help me in that. Show button to form when job there is specific job type(lets take a typetype=abc but it is a lookup), i try enable rule in ribbon workbench. Can anyone help me to write a javascript code for that.
1. Create a javascript library which contains below code to check the Job Type name and return boolean value based on the selected Job Type
function enableButton(executionContext) { var isABCJobType = false; var jobType = executionContext.getAttribute("").getValue(); isABCJobType = jobType != null && jobType[0].name.toLowerCase() == "abc"; return isABCJobType; }
2. Add enable rule (Custom Rule) in ribbon workbench, this calls custom javascript function enableButton. Also pass CRM Parameter 'Primary Control' to the javascript function. In my case below, I have created a javascript library called new_Account.js which contains a function enableButton.
Enable Rule - Custom Rule:
Hi Parul,
You want to hide one button based one field value, and the field is lookup field, right?
Maybe you can use ‘ValueRule’ of Disply Rule to hide it directly without js code, which will be easier.
Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench | D365 Demystified
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
not working
Can you share some screenshots related to the lookup field and ribbon workbench?
I'm not able to solve my problem please help me in that. Show button to form when job there is specific job type(lets take a typetype=abc but job type is a lookup), Can anyone help me to write a javascript code for that.
Please find the information below:
https://balugajjala.wordpress.com/2017/01/27/enabledisable-a-ribbon-button-dynamically-based-on-a-form-value/
If still not working, please raise support request with Microsoft at https://admin.powerplatform.microsoft.com/support.
Best Regards,
Mobeen Mohsin
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 55 Super User 2025 Season 2
Daniyal Khaleel 27 Most Valuable Professional
Soundari 15