how GLIDEURL will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2020 02:48 AM
we have one ui action to create change request under standard template when we click on that one it redirecting to empty page
in ui action GLIDEURL used
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2020 02:55 AM
Hi Madan Kumar,
Please refer to this community link. It has a proper description with example:
Please mark as correct and help close this thread if this solves your query.
Thanks
DR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2020 03:00 AM
var stdChangeRecordProd = new GlideURL('std_change_processor.do');
stdChangeRecordProd.set('sysparm_id', current.getUniqueValue());
stdChangeRecordProd.set('sysparm_action', 'execute_producer');
stdChangeRecordProd.set('sysparm_catalog',current.sc_catalogs);
action.setNoPop(true);
action.setRedirectURL(stdChangeRecordProd.toString());
above is my code how set function will work and processor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2020 07:38 AM
As you have just created the change request, is it fetching value for "current.getUniqueValue())"? Please use a log statement to print "stdChangeRecordProd.toString()" and check the outcome.
The OOB incident module uses this ui action to redirect after change creation:
https://YOUR_INSTANCE.service-now.com/sys_ui_action.do?sys_id=30c9566dc61122740030e173564c1c74&sysparm_record_target=sys_ui_action&sysparm...
This is the script used to get a redirect URL:
(function(current, previous, gs, action) {
var changeRequest = ChangeRequest.newNormal();
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.cmdb_ci);
if (changeRequest.hasValidChoice('priority', current.priority))
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
changeRequest.insert();
current.rfc = changeRequest.getGlideRecord().getUniqueValue();
current.update();
var incUrl = "<a href='" + current.getLink(true) + "'>" + current.getDisplayValue() + "</a>";
gs.addInfoMessage(gs.getMessage("Normal Change {0} created from {1}", [changeRequest.getValue("number"), incUrl]));
action.setRedirectURL(changeRequest.getGlideRecord());
action.setReturnURL(current);
})(current, previous, gs, action);