make field mandatory

Deepanshi1
Mega Guru

hi i want to make field mandatory when my comlexity field changes. how can i do it. i have created ui policy for it but it is coming for all value i only have to do when complexity changes.

3 ACCEPTED SOLUTIONS

where do i write this record?

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@Deepanshi1 Here are the steps to create a client script to make a field mandatory.

1. Search for Client script module in Application Filter. >> Click New 

Screenshot 2024-05-02 at 2.51.46 PM.png

2. Configure the client script as follows.

Screenshot 2024-05-02 at 2.54.32 PM.png

View solution in original post

@Deepanshi1 
do it in client script search in application navigator and use onchange on the field


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

View solution in original post

17 REPLIES 17

AnimeshP_96
Tera Guru

hey @Deepanshi1 
So if you go by UI policy  conditions would be complexity field changes then create  a record in UI policy actions and make a field mandatory , if you don't have the "changes"  option available then use code below

 

if(NewValue!=oldValue)

{

g_form.setMandatory('fieldname',true)

}

 

let me know if this works...if yes mark this as close, if not share the problem


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

@Deepanshi1 is the above code which i have posted is working?


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

where do i write this record?

@Deepanshi1 
do it in client script search in application navigator and use onchange on the field


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

Jaspal Singh
Mega Patron
Mega Patron

Hi,

As per shared configuration field will be mandated when Complexity is either Simple, Complex or Critical.

I assume you feel it mandatory as Complexity field has no default value as one of Simple, Complex or Critical and not as None and thus the case.