Variable section

ashok17
Tera Contributor

Hi All,

Variable section should visible only if incident raised through service portal but If any user raise incident through Like All-->Incident--> create new the Variable section should not visible in incident form.

I have added in Section Incident Variable Editor in incident form design and written below client script for variable read-only this is working fine but If user raised incident using All-->Incident--> create new the variable section showing empty.

g_form.setVariablesReadOnly(true);

Please suggest for this requirement.

10 REPLIES 10

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @ashok17 ,

 

You can write a client script and check if the variables are empty or not. And if they are empty you can make varible editor to hide.

 

Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.


Regards,

Siddhesh

Ankur Bawiskar
Tera Patron
Tera Patron

@ashok17 

ideally it should not be shown if your incident is not created from any record producer

If still not working then do this

1) use onLoad client script and hide it if the incident is getting created

2) check this using g_form.isNewRecord()

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi

 

Thanks for response, Please find attached screenshot and If I am creating new incident through All-->Incident--> create new the Variable section showing empty.

 

As per your above details, how to achieve this, please explain me brief. that will help full for me. 

Hello @ashok17 ,

You can hide variable section using client script if the form is new record 

g_form.setSectionDisplay('section_name', false);