- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2020 05:43 AM
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?
Solved! Go to Solution.
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 01:00 AM
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>
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 02:03 AM
Hi Peeyush,
Did you accidentally mark some other answer as correct?
Please remember to mark relevant reply as "helpful" or being the "correct answer".
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 02:39 AM
Hi Ankur,
I marked both the answers as correct because there are two part in my question, one is to set reason as mandatory and another one is to make value default.
But I think it took only one as correct answer. Can we mark two answers as correct here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 02:58 AM
Hi Peeyush,
nope; only 1 you can mark as correct.
you can mark the appropriate reply as correct answer.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 11:06 AM
Hi,
If you wanted to add the value for "Reason" in the work notes in what script would that be done? Currently, only the work notes entered in the dialog box show up on the record but I'd like to add the value for "Reason" also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 01:32 PM
Hi Ankur,
In HR form, we are using Suspend UI action and OOB we are getting Reason & Work Notes field in the dialog box. Now, we would like to make Due Date field as mandatory in the form when Suspend Reason dialog box change gets saved?
I think making a field mandatory when the control is in dialog box would be quite tricky. However, I think I should include Due Date too in the Suspend Dialog Box and make it mandatory and after filling the value should be displayed in the Due Date field in the form.
Could you please help or guide me to achieve this?
Quick reply would be much appreciated.