Skip to main content

Notifications

Announcements

No record found.

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

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
    SarahMoustafa 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
    Parul Sharma 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
    Community Member Microsoft Employee 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans