Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2024-09-27 12:17 PM - edited 2024-10-10 11:58 AM
A client recently asked for having the Actions dropdown in AWF enrolled records to be replaced with buttons, and hiding the Edit/View buttons. I saw some examples of hiding buttons in earlier forum articles and incorporated the ideas into creating a script that hides the Edit/View button, hides the Actions dropdown, and puts buttons onto the screen based on the workflow status. Special thanks to @ThemistoclesC for providing the basis of getting this to work.
A few notes about the script:
1. The workflow status field needs to be a text type for the conditional logic to work, so I created a text field and calculated it from a status values list
2. The text field must be visible on the layout somewhere
3. The section where the custom object is placed should be hidden through a conditional layout rule/action to prevent the buttons from appearing elsewhere on the record
4. Use a browser Inspector tool to obtain the onclick events that are needed for the workflow action nodes
The attached script is provided as-is and needs to be customized based on the target environment, field IDs, etc. It worked for my client on-prem in version 2024.08 but will need adjustments to work elsewhere.
Update 10/10/2024 - Added another script that allows for controlling button display based on workflow action node checks instead of using a status field.