client script

soniya patil
Tera Contributor

how to make  short description field  mandatory  in table

7 REPLIES 7

PA001
Mega Sage

Hello Soniya,

 

Write a onload script by adding below line of code to mandatory.

 

 g_form.setMandatory('caller', true);
 
Thanks,

Harish Bainsla
Tera Sage
Tera Sage

Hi you can use

 g_form.setMandatory("short_description", true);

Nayan  Dhamane
Kilo Sage
Kilo Sage

Hello @PA001 ,

Please create a UI policy. Mark your conditions if any ang using its action make the field mandatory.

This is the standard practice.

 

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Vaibhav
Mega Guru

Hello Soniya,

You can make field mandatory by

1. UI Policies : Adding UI Policy Action - Field Name + Mandatory is True

2. Data Policies : Adding Data Policy Rule - Field Name + Mandatory is True [Data Policy only works for server side]

3. By Client Script using below line of code : 

 

 

g_form.setMandatory('short_description', true);

 

 

4. From Field dictionary, refer below ss and make True Mandatory field

Screenshot 2023-08-25 at 4.00.32 PM.png