Manipulate URL from client script

Useful snippets for working with URL from a lient script

Redirect to a page with a form for creating a new record

var query = [
  "active=true",
  "short_description=Created " + moment().format("YYYY-MM-DD")
].join("^");
var url = new GlideURL("incident.do");
url.addParam("sys_id", "-1");
url.addParam("sysparm_query", query);
window.location = url.getURL();
Andre Kosak
ServiceNow Developer, Freelancer

Develop whatever!

comments powered by Disqus

Related