Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Java script code to enable button (Ribbon work bench) in booking entity if booking is more than 3

(0) ShareShare
ReportReport
Posted on by 80

If have added button abc in appointment booking. This button is only visible when number of booking is greater than 3

  • Suggested answer
    SarahMoustafa Profile Picture
    25 on at
    RE: Java script code to enable button (Ribbon work bench) in booking entity if booking is more than 3

    Hi,

    There's an OOB enableRule called SelectionCountRule that could fulfill that need without coding only if it's okay for the user to manually select the records. In other words, the ribbon will be visible if at least 3 records are selected.

    If you want the ribbon to auto count that without user interaction, you can use retrieveMultiple in the enable JS function to get execute the view query and then check on the returned length and based on it, show or hide the ribbon. Not the best in terms of performance so try as much as you can to optimize the query to get only what's needed.

  • Parul Sharma Profile Picture
    80 on at
    RE: Java script code to enable button (Ribbon work bench) in booking entity if booking is more than 3

    No, button is only visible when there are more than 3 booking is present in the view

  • Community Member Profile Picture
    on at
    RE: Java script code to enable button (Ribbon work bench) in booking entity if booking is more than 3

    Hi,

    Do you mean that the added button should be visible when the selected number of booking is greater than 3 in the view, Otherwise the button should be hidden?

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.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans