The CreatorCon Call for Content is officially open! Get started here.

How to change Mandatory Assigned to field when state is complete.

ND7
Kilo Sage

Dear Expert, 

 

I need to specify a requirement for the Catalog Task. Whenever a technician tries to complete the task, it is mandatory for them to fill in the 'Assigned to' field. 

 

So when the state is close complete make the Assigned to field set to Mandatory.  

Please help.

Thank you, 

 

ND7_0-1689255199791.png

 

 

1 ACCEPTED SOLUTION

sushantmalsure
Mega Sage

Write a UI Policy on sc_task table.

 

Condition: State = Closed Complete

sushantmalsure_0-1689256037495.png

 

 

Then in UI policy action related list :

Click New Button

sushantmalsure_1-1689256065938.png

 

Add a record as 'Assigned to '> Mandatory to true

rest all like visible and read only leave as it is..

sushantmalsure_2-1689256118855.png

 

Then check again on same task.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

View solution in original post

3 REPLIES 3

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @ND7 

Greetings!

try Before Business Rule as below

Table : Catalog Task
Advanced : True
When to Run. When : Before
When to Run. Update : True
When to Run. Filter Condition : <State> <Changes To> <closed complete>
Advanced Script should be below:

(function executeRule(current, previous /*null when async*/ ) {

if (JSUtil.nil(current.assigned_to)) {
gs.addErrorMessage('Assigned To should be updated while closing the task');
current.setAbortAction(true);
}
})(current, previous);

Help others to find a correct solution by marking the appropriate response as correct answer and helpful!!

Kind Regards,

Ravi Chandra.

sushantmalsure
Mega Sage

Write a UI Policy on sc_task table.

 

Condition: State = Closed Complete

sushantmalsure_0-1689256037495.png

 

 

Then in UI policy action related list :

Click New Button

sushantmalsure_1-1689256065938.png

 

Add a record as 'Assigned to '> Mandatory to true

rest all like visible and read only leave as it is..

sushantmalsure_2-1689256118855.png

 

Then check again on same task.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Clara Lemos
Mega Sage

Hi @ND7 ,

 

You could also do it via UI Policy

Condition: state is 'Closed complete'

Ui Policy action: Assigned to mandatory

 

Let me know if that helps!