Set variable as not mandatory if CTASK state is incomplete

Miguel Sanchez1
Tera Contributor

Hello everyone,

 

I'm working on a workflow and in one of my tasks I'm displaying a couple of variables as mandatory. However, if the assigned user decides to close this task as incomplete, I need to make them non-mandatory in order for the user to be able to close it (filling in these variables wouldn't be necessary if the task is closed as incomplete).

 

  1. I was planning to use a UI policy but from there, I don't seem to have access to the catalog variables to change them to non-mandatory.
  2. If I use a Catalog UI policy, then, I don't have access to the state of the CTASK to use it as my condition.
  3. If I use a UI policy/Catalog UI policy, would it be executed when the user changes the state of the task (without saving it)?

 

I know that to make fields/variables mandatory, best practice is to use UI policies/Catalog UI policies, but due to above first two points, I haven't been able to. Now I'm thinking about using an onChange script to achieve this but I'd be coding the whole thing (if state is "Closed complete" make them mandatory, if it is "Closed Incomplete", make them non-mandatory) and I'm not sure if this is a good idea.

 

Any guidance will be greatly appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Miguel,

 

How is the agent closing the task? Clicking on the UI action or changing the state manually?

If by clicking the Close UI action you can add the client side logic to make fields non-mandatory & if manually, then you need onchange client script.

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi Miguel,

 

How is the agent closing the task? Clicking on the UI action or changing the state manually?

If by clicking the Close UI action you can add the client side logic to make fields non-mandatory & if manually, then you need onchange client script.

Hello Jaspal,

 

Thanks for the quick reply. They are manually changing the state using the combo box in the form and then saving. I guess then, I'll have to make the script for this one.

 

Thanks a lot Jaspal!

Yes, Miguel. Let us know if you need further assistance. If not, you can close the thread by marking suitable answer correct.