- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 04:02 AM
Hello,
We have customized the UI page 'HR Suspend Dialog' which is being called from the 'Suspend' and 'Suspend case' UI action. As per the customization, Work notes field is NOT displayed always. It is displayed only when certain suspension reason is selected. We want the same functionality in HR Agent workspace as well.
If we look into the OOTB code for workspace , Work notes field has been defaulted and displayed always with below code:
https://devxxxx.service-now.com/sys_ui_action.do?sys_id=b65370019f22120047a2d126c42e701d&sysparm_view=&sysparm_record_target=sys_ui_action&sysparm_record_row=1&sysparm_record_list=sys_id%3Db65370019f22120047a2d126c42e701d%5EORDERBYorder&sysparm_record_rows=1
I want to display work notes field only when certain reason is selected. Please advice.
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 06:05 AM
Hi Pooja,
Consider it as a workaround to fulfill your requirement. You can try to show two modals
- Take Reason
- Take Work Notes
When user has provided the reason for which you want to show the work notes field, show another modal to take work notes from user. See the below script for reference.
function onClick(g_form) {
var type = [{
type: 'choice',
name: 'u_type',
label: 'New Type',
mandatory: true,
value: getMessage(' -- Select -- '),
choices: [{
displayValue: 'Best',
value: 'Best'
},
{
displayValue: 'Bad',
value: 'Bad'
}
]
}];
var workNote = [{
type: 'textarea',
name: 'work_notes',
label: 'New Type',
mandatory: true,
value: getMessage('Work notes')
}];
g_modal.showFields({
title: 'Enter New Values',
fields: type,
size: 'lg',
height: 'md'
}).then(function(selectedType) {
if (selectedType.updatedFields[0].value == 'Best') {
g_modal.showFields({
title: 'Enter New Values',
fields: workNote,
size: 'lg',
height: 'md'
}).then(function(newWorkNote) {
g_form.setValue('u_type', selectedType.updatedFields[0].value);
g_form.setValue('work_notes', newWorkNote.updatedFields[0].value);
g_form.save();
});
} else {
g_form.setValue('u_type', selectedType.updatedFields[0].value);
g_form.save();
}
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 03:15 AM
Hi
Thank you for the workaround!
Please let us know how to display Date/Time field using g_modal.showFields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2023 04:14 AM
Hello! I have same requirement, did you find something related to display date/time picker in Workspace modal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2025 10:46 AM
Is it possible to use 1 modal. The customer doesn't like the 2 modals. Is it possible to show/hide the field in 1 modal? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2023 02:51 PM - edited ‎07-07-2023 02:52 PM
How can we use the reference qualifier in the UI action where I'm using the same modal code.
I need to show the service offerings based on service (Parent)
if I select the service, it should show the service offerings related to that service. Is it possible ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 11:45 PM
Hi royi
Did you get the solution for this? I am having the similar requirement .Can you help on this?