- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 06:26 AM
Hello Experts!
I have a service request workflow set up where i have few catalog tasks created. I want variable 1 set to mandatory and visible for TASK 1, Stage "fulfillment 1" . Once the task is closed, i want Variable 1 to be read only for the rest of the workflow stages.
Trying to achieve this with UI policy. I have condition set: If variable 1 is not empty: set it to read only
Which works fine but once variable is filled with value, it is not editable (in case need changes before closing the Task)
Can we use stages to separate the two, and then the ui policies can look to the stage for when they should make those fields read-only?
If so, how can i achieve this?
Please advice!
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 12:36 PM
Can you share your script - this should be onLoad. The script doesn't specify whether the variable is populated, or the State of the task, it's just a straight 'If the task form being display is this certain task, the variable is mandatory, otherwise it's read-only'. If you're seeing the variable change to read only once a value is entered then you have another client script or UI policy affecting this variable. If the variable definition specifies mandatory = false as it should, and no other scripts or policies are working against this script, then the script I provided is all you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 01:31 PM
Hello Brad,
I was able to achieve this with ui policy.
if (g_scratchpad.wf_activity == 'Workflow activity task 1' ){
g_form.setMandatory('variable 1', true);
g_form.setDisplay('variable 1',true);
}
if (g_scratchpad.wf_activity == 'workflow activity task 2' ){
g_form.setMandatory('variable 2', true);
g_form.setDisplay('variable 2',true);
}
if (g_scratchpad.wf_activity == 'Workflow activity task 1'){
g_form.setReadOnly('variable 1', true);
g_form.setDisplay('variable 1', true);
}
if (g_scratchpad.wf_activity == 'workflow activity task 2'){
g_form.setReadOnly('variable 2', true);
g_form.setDisplay('variable 2', true);
}