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

How to create Catalog UI Policy on Incident (record producer) to apply UI Policy action to variable?

Bird1
Mega Sage

I am creating 1 record producer to Incident table. There are some variable in this catalog.

What I need to do is to create UI Policy if Incident state is in Resolved, the variable field must be mandatory to fill in.

I cannot set the condition on Incident state, I could see only variable field. Anyone can help?

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

you have not read my earlier response.

You need to create normal client script on incident table and not catalog client script and then use script I shared

find_real_file.png

Regards
Ankur

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

View solution in original post

11 REPLIES 11

@Bird 

Here is the onChange client script on incident table state field

function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue == '') {
		return;
	}

	if(newValue.toString() == '6')
		g_form.setMandatory('variables.variableName', true); // give your variable name
	else
		g_form.setMandatory('variables.variableName', false); // give your variable name

}

Regards
Ankur

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

Still no luck, the "state" variable, I map to incident state already. But the filled_by_it_engineer still not mandatory yet once incident state is changed to resolved.

 

find_real_file.png

find_real_file.png

Hi,

you have not read my earlier response.

You need to create normal client script on incident table and not catalog client script and then use script I shared

find_real_file.png

Regards
Ankur

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

Thank you, it's workable now.

Anand Shukla
Mega Guru

Hi Bird,

I think you need to create a UI policy on Incident table.

 

you can use below Sample UI policy and change the UI action field name according to your use.

find_real_file.png

 

Hope it helps

Mark it Helpful and Correct.

Thanks

Anand