RE: How to look at code behind button on ribbon?
Hi,
You can use the Command Checker. First you need to add "&flags=FCB.CommandChecker=true&ribbondebug=true" to your URL. You will get something like:
https://yourOrg.crm4.dynamics.com/main.aspx?appid=f9e00965-1b80-eb11-b1ab-000d3a4a16f3&flags=FCB.CommandChecker=true&ribbondebug=true
After adding the flag to the url a new button will appear on your ribbon that allows debugging:

Deactivate button as an example:

The command checker shows us that the JavaScript function associated to the Deactivate command is XrmCore.Commands.changestate.changeState from the Main_system_library.js library.
Also, the command checker gives us the details of enable rules and display rules:
