web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

ribbon button validation javascript Ribbon Workbench

(0) ShareShare
ReportReport
Posted on by

Back in the day (I'm sure few of you remember) one would add validation script to buttons -- if the function returned true the button action continued else it would just stop.

In the ribbon it doesn't appear to have the same functionality.  Looks like I can control button enablement via javascript but, not the firing of the action.  E.g. Opportunity Create Order fires action of CloseAsWon.  Is there a way to check a condition OnClick and have the action either proceed or be interrupted?

All I can see is how to check the condition -- and flash the alert -- on form load while using an enable rule. I.e. onLoad vs onClick.

Am I missing something?

TIA

-md

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    What you can do here - you can customize the command of the button, copy the handler that is being called and develop own function that do validation and call OOB handler if validation is passed. I did that for Close as Won/Close as Lost for Opportunity.

  • Community Member Profile Picture
    on at

    Thanks AB.  Sounds dangerous.  Not sure I know how to call a handler.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Here is the post that can help you - dynamics365blocks.wordpress.com/.../

    With the handler I meant JS method that is called by the OOB button - so OOB JavaScript function.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans