logo

NJP

Important Points to Configure Workspace in Now UI Experience

Import · Aug 23, 2022 · article
Methods Alternative Solution
getReference() not supported Use GlideAjax or getReference() with callback()
GlideWindow Not supported Use g_modal.showframe
gsftSubmit() not supported in ui action to call server side code g_form.submit(g_form.getActionName()); Used
System stored message (sys_us_message) not suppoted Can use direct text message using , gs.addMessage("test",type) /gs.addInfoMessage("text")/ etc.
current.abortAction () not supported Create script at global scope and call it in scoped application side
getXmlWait() not suppoterd Use getXml() with callback function
Jelly Script / JSON not supported -hence UI page will not work Convert them to UI action - and provide similar functionality

1.UI action

  • 1.1 Workspace client script -- Used to write client side code
  • 1.2 Script code - Used to write server side code
  • 1.3 UX format configurable - Check true - to visible on foem level
  • 1. 4 Custom UI action should be created in that scoped application.

2.Client Script

  • 1.1 Client script with UI type - All - in global scoped supports
  • 1.2 If client script contains GlideAjax() with getxmlwait () - not supported

Example -

G_modal

var fields = [ { type: 'reference', // Reference field name: 'assignment_group', label: getMessage('Assignment Group'), mandatory: true, reference: 'sys_user_group', referringTable: 'incident', // applied on which field referringRecordId: g_form.getUniqueValue() }, { type: 'textarea', //text type field name: 'work_notes', label: getMessage('Work Notes'), mandatory: true },

];

g_modal.showFields({ title: "Assign ticket to yourself", // Name of page fields: fields, size: 'lg' }).then(function(fieldValues) { g_form.setValue('work_notes', fieldValues.updatedFields[1].value); // seting value to work notes g_form.setValue('assignment_group', fieldValues.updatedFields[0].value); // setting the value to assignment group g_form.save(); });

}

Please mark Helpful, if applicable.

Thanks,

Supriya

image

View original source

https://www.servicenow.com/community/now-platform-articles/important-points-to-configure-workspace-in-now-ui-experience/ta-p/2312159