Looking to disable the Add & Review button for a particular service? Here's how.....
This item is contributed through one of our newScale Service Design consultants. I know that there is another post in the site (contributed by Brandy DeMarco at McKesson) with some of this information, however, the actual JavaScript code didn't seem to survive the migration from our previous site to this new site.
Step 1: Create the JavaScript "CMN_DisableAddReview" noted below:
CMN_DisableAddReview() {
if (Moment === 'ordering') {
locateFormElement = function(name) {
var firstChild = document.getElementById(name).firstChild;
while (firstChild.nodeType != 1)
firstChild = firstChild.nextSibling;
for (var x = 0; x<firstChild.childNodes.length; x++)
if (firstChild.childNodes[x].nodeType == 1)
return (firstChild.childNodes[x]);
};
// Locates the Add & Review header parent object within the HTML DOM
FormHeaderName = 'cheader';
locateFormElement(FormHeaderName).disabled = true;
// Locates the Add & Review footer parent object within the HTML DOM
FormFooterName = 'cfooter';
locateFormElement(FormFooterName).disabled = true;
}
}
Step 2: Add the JavaScript in only 1 of the service specific AFCs in the Active Form Behavior Tab for the form onLoad Event