Add show workflow UI Action in ServiceNow for Global and scoped applications

For Global Application use the following script   onclik: showWorkflowContext()   condition: !current.isNewRecord() && (new Workflow().hasWorkflow(current))   function showWorkflowContext() {    var id = g_form.getUniqueValue().toString();    var url = new GlideURL(‘context_workflow.do’);    url.addParam(‘sysparm_stack’, ‘no’);    url.addParam(‘sysparm_table’, g_form.getTableName());    url.addParam(‘sysparm_document’, id);    g_navigation.open(url.getURL(), “_blank”) }   For Scoped Application use the following script   onclik: showWorkflowContext()   […]

Remove back button on ServiceNow form view

  Remove the back button on the any form view in ServiceNow                                                        Please use the below client script for that particular form load function onLoad() { document.getElementsByClassName(“btn btn-default […]

Convert the timezone to GMT timezone in ServiceNow

// start and end dates are in the client’s timezone var start = current.u_change_start_date.getGlideObject().getNumericValue(); var end = current.u_change_end_date.getGlideObject().getNumericValue(); var gdt = new GlideDateTime(gs.nowDateTime()); var timeZoneOffSet = gdt.getTZOffset(); // start and end times are in the current timezone // current date time is in the GMT timezone // converting start and end times to GMT timezone […]