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

When time worked is updated I want only restrict all fileds except assinment group and assigned to

mania
Tera Contributor

Hi,

 

I have restricted all the fields when before time worked field is updated It is showing like "Please fill the time worked before updating the ticket" But here I am facing one issue like I dont want to restrict Assignment group and assigned to so I want only restricting remaining fields(Except Assignment group and assigned to fields).

I wrote one BR for restrict all fields and attached below screen sorts. 

How to do that can anyone help me on this, It will be helpful.

mania_0-1708589040955.png

mania_3-1708589099261.png

Thanks in Advance!

1 ACCEPTED SOLUTION

Looks like you added the Assignment group and assigned to variables inside the gs.nil move it out of that. Like this if(gs.nil(current.time_worked) || current.time_worked == previous.time_worked && !(assignmentGroupChanged || assignedToChanged))

View solution in original post

6 REPLIES 6

Sarika S Nair1
Kilo Sage

Hi @mania , 

Instead of creating BR,,, try to achieve this by using UI Policy. You can make all required fields as read only when time worked is not filled.

@Sarika S Nair1 

 

Thanks for your Responding!

 

How to do it, Can you please provide steps for this. It be helpful

 

Thanks!

Mania

 

Gustav Aldenbra
Kilo Sage

Hi @mania

If I'm reading your question correct you want to be able to change assignment group and assigned to even if worked time is empty or same as before.  If you add two variable: 
var assignmentGroupChanged = current.assignment_group.changes();
var assignedToChanged = current.assigned_to.changes();

 

Then update your if statement to also check if the assignment group or assigned to did not change
&& !(assignmentGroupChanged || assignedToChanged)

 

I have not tested this myself but it should work.

@Gustav Aldenbra 

 

Thanks for your Responding!

 

I have applied code which you provided but not working. Actually I need like Before I updating the time worked field its working all fields restricted but now I want only Except assignment group or assigned to It should restrict all fields.

Can you please help on this. It will be helpful

mania_0-1708607477626.png

Thanks!

Mania