How to write Back end script for radio buttons(Yes/No) based on other selection?

Service Now4
Giga Contributor

Hello Everyone,

I have a requirement that - if we select DMS - Core in Access Required to, the Remote Access(Yes/No) field must to be Hide. - I have done this by using Catalog UI Policy and Catalog UI Policy Actions.

And Can any one please help me with this : How to Keep the value 'Yes' in the Backend.

Please find the below Screenshot for your Reference,

find_real_file.png

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi,

 

Set the default value to yes as shown in image.

find_real_file.png

Regards,

Sagar Pagar

 

The world works with ServiceNow

View solution in original post

16 REPLIES 16

can you elaborate below line ?

 But in Back end it is not showing 

 

what do you mean by back-end , you mean RITM variable editor ? or in database table?

 

 

UI policy working fine as per condition & policy action you mentioned.

As per UI policy, if you select 'DMS - Core' in Access Required to field, the Remote Access(Yes/No) field will be hidden.

 

If you want to show & always select to 'yes' in the RITM view, just remove the 'Applies on Requested Items' checkbox.

or

Explain in details, will solve this.

 

Regards,

Sagar Pagar

 

The world works with ServiceNow

Thank you, it works now....I forgot to disable the UI Policy for RITM.

Thanking you.......

find_real_file.png

Regards,

Jayasree

Hi Sagar,

Request for DMS - Core; if the user changes the Remote Access field to 'NO' before selecting the application(DMS - Core) in Portal, the NO is carried forward – expected behaviour was to ALWAYS force Remote Access = 'YES'.  Could you Please help me with this issue.

Thanks&Regards,

Jayashree

you can write onSubmit catalog client script here to validate it the "access required to" field value and based on that set the multiple choice field value to yes.

 

eg:

 

function onSubmit() {
	//Type appropriate comment here, and begin script below

	if(g_form.getValue('access_requested_to')=='sysid of the DMS - Core'){
		
		g_form.setValue('remote_access','yes');

	}

}

 

 

 

Note: make sure you enter the correct variable name . 

 

If my answer helped you, mark it as correct and helpful.