F
orm buttons and context menus are usually a desirable piece of functionality to include on your form. I have seen scenarios before however, where I needed to limit the options available to a user so that they could really only perform one action. The first options that I would consider in these situations is to simply modify the ‘Condition’ field (for role-specific or other criteria) or the ‘UI Action Visibility’ related list (for view-specific criteria) on the particular UI action that I wanted to remove from the user’s view. This is obviously the best and simplest method since it falls in line with the design of the product and doesn’t really require any unusual override of other system behavior.

But what if you need to disable something like the ‘Submit’ button on just a single view of a single form? What if you wanted an easy way to disable everything BUT one button based on a change to a particular field? Modifying the UI action condition in these scenarios might not make sense because you don’t want to include a one-off condition for just a single use case or (in the onChange scenario), the UI action conditions are only evaluated on form load so they wouldn’t apply anyway.
This article shows a couple of client script functions that allow you to remove (show/hide) any button (or all but one button)…and, if necessary, disable the form header right-click context menu entirely.
Learn more ...