How to set Suspend Reason Mandatory and default value?

Peeyush Jaroli
Tera Expert

Dear Community Members,

I have a requirement where I need to make Suspend Reason mandatory which pops up when clicked on suspend case button. How can I do that?

Another requirement is to make a value as default one. For example I have item1 to item 4, I want item 3 to be selected by default.

How can I do that?

 

 

1 ACCEPTED SOLUTION

Hi Peeyush,

I updated in my instance and it now shows Group as default but shows in order correctly

script updated below

<select id="suspend_reason" class="form-control" name="suspend_reason">
	<j:while test='${reasons.next()}'>
		<j:if test="${reasons.getValue('value') == suspension_type}">
			<option value="${reasons.getValue('value')}" selected='selected'>${reasons.getValue('label')}</option>
		</j:if>
		<j:if test="${reasons.getValue('value') != suspension_type}">
			<j:if test="${reasons.getValue('value') == 'group'}">
				<option value="${reasons.getValue('value')}" selected='selected'>${reasons.getValue('label')}</option>
			</j:if>
			<j:if test="${reasons.getValue('value') != 'group'}">
				<option value="${reasons.getValue('value')}">${reasons.getValue('label')}</option>
			</j:if>
		</j:if>
	</j:while>
</select>

find_real_file.png

find_real_file.png

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

22 REPLIES 22

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Peeyush,

So you will have to use client side UI action?

Have you started on that piece? where are you stuck?

can you share screenshot?

Regards
Ankur

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

Hi Ankur,

I am not sure where to start with. Was trying with UI policy but that is making field mandatory on form not on pop up.

Can you guide on using client script.

Hi Peeyush,

So you are saying you require Suspend Case button? you will require both client+server side UI action

on click of it; if suspend reason is not populated then set it mandatory?

once it is populated; what should happen? what fields to be updated with what values

https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

 

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

I have a suspend button, when clicked, it will show pop up dialog box.

'I have two req:

Make default reason show up instead of none.

Like work notes, Reason should be mandatory too.