Closed complete state INVISIBLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 12:34 PM
Hello dear community, I need help:
I need the "closed complete" state of a task in a workflow to be "invisible" to the user (please see photo attached).
The idea is to make it invisible for certain tasks, not to remove that state. Does anyone know how I can achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 01:07 PM
Hello @Alessa,
There are multiple ways you can achieve it. It depends upon your use case.
If you want to hide it for process related restrictions. Please try leveraging State Management.
This helps you provide process related controls.
Other ways could be to use Client Scripts or UI Policies based on your conditions.
To hide the “closed complete” state of a task in a workflow from the user using a client script, you will need to follow these steps:
- Navigate to System Definition > Client Scripts in the application navigator.
- Click New to create a new client script record.
- In the Name field, enter a name for your client script. For example, “Hide Closed Complete State”.
- In the Table field, select the table that contains the task records. For example, “Task [task]”.
- In the Type field, select “onChange” as the type of client script. This means that the script will run when a field value changes on the form.
- In the Field name field, select the field that triggers the script. For example, “Type”.
- In the Script field, enter the following code:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// Get the state field element
var stateField = g_form.getControl('state');
// Get the state field options
var stateOptions = stateField.options;
// Loop through the state options and find the one with value 3 (Closed Complete)
for (var i = 0; i < stateOptions.length; i++) {
var option = stateOptions[i];
if (option.value == '3') {
// Hide or show the option depending on the type of task
if (newValue == 'Some Task Type') {
// Hide the option
option.style.display = 'none';
} else {
// Show the option
option.style.display = '';
}
break;
}
}
}
- Click Submit to save your client script.
You should now see that the “closed complete” state of a task in a workflow is hidden from the user when they select a certain type of task in the form.
To hide the “closed complete” state of a task in a workflow from the user using a UI policy, you will need to follow these steps:
- Navigate to System UI > UI Policies in the application navigator.
- Click New to create a new UI policy record.
- In the Name field, enter a name for your UI policy. For example, “Hide Closed Complete State”.
- In the Table field, select the table that contains the task records. For example, “Task [task]”.
- In the Condition field, enter an expression that defines when the UI policy should apply. For example, “Type is Some Task Type”.
- In the Reverse if false field, check the box to indicate that the UI policy should be reversed when the condition is false.
- Click Submit to save your UI policy record.
- Click New under the UI Policy Actions related list to create a new UI policy action record.
- In the Name field, enter a name for your UI policy action. For example, “Hide State Option”.
- In the UI policy field, select your UI policy record. For example, “Hide Closed Complete State”.
- In the Field name field, select “State”.
- In the Choice field, select “Closed Complete”.
- In the Visible field, uncheck the box to indicate that the choice should be hidden.
- Click Submit to save your UI policy action record.
You should now see that the “closed complete” state of a task in a workflow is hidden from the user when they select a certain type of task in the form.
Hope this helps.
Kind Regards,
Swarnadeep Nandy