Need help in passing value from UI Action to UI Page
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 02:25 AM - edited 03-01-2024 05:58 AM
I'm trying to achieve a requirement that if one of the field is populated via form directly, this value should pass to the modal window, 2nd field should be added via modal and then the incident should be moved to resolved sate...
UI Action:
function resolveIncident() {
var resolutionCode = g_form.getValue('close_code');
var closeNotes = g_form.getValue('close_notes');
if (resolutionCode && closeNotes) {
g_form.setValue('incident_state', 6);
g_form.setValue('state', 6);
g_form.setValue('resolved_by', g_user.userID);
gsftSubmit(null, g_form.getFormElement(), 'resolve_incident');
} else {
var sysId = typeof rowSysId == 'undefined' ? gel('sys_uniqueValue').value : rowSysId;
var gDialog = new GlideModal('resolve_incident_modal');
gDialog.setTitle("Closure Information");
gDialog.setPreference('sysparm_choices', JSON.stringify(g_scratchpad.resolutionCodeChoices));
gDialog.setPreference('sysparm_sys_id', sysId);
gDialog.setPreference('sysparm_table', 'incident');
gDialog.setSize(600, 300);
gDialog.render();
}
}
if (typeof window == 'undefined')
serverResolve();
function serverResolve() {
current.incident_state = IncidentState.RESOLVED;
current.state = IncidentState.RESOLVED;
current.resolved_by = gs.getUserID();
current.update();
gs.setRedirect(current.getLink(true));
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 09:37 AM
Is the question related to Workspace or native side in ServiceNow?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 02:05 AM
@Dibyaratnam For the first, It needs to be done on classic UI, then I'll work for workspace with same requirement