- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 03:13 AM
Hello,
I am using script include to create incident.
I want to show the message when incident is being created.
In the below code its showing the sys_id of the incident.Can some one help on this.
gs.include("FormInfoHeader");
var fi = new FormInfoHeader();
var s = 'Thanks! Incident number ' + inc.sys_id.getDisplayValue() + ' has been created!.<br/>';
fi.addMessage(s);
Thanks
saranya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 03:15 AM
inc.number instead of inc.sys_id.getDisplayValue()
getDisplayValue should only be used if you are looking at a reference field and you want to return the DisplayValue instead of the sys_id of the referenced record, even if incident was a reference field in this occasion it would only be inc.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 03:15 AM
inc.number instead of inc.sys_id.getDisplayValue()
getDisplayValue should only be used if you are looking at a reference field and you want to return the DisplayValue instead of the sys_id of the referenced record, even if incident was a reference field in this occasion it would only be inc.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 08:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 01:09 AM
Put the url into the message, something along these lines:
var url = gs.getProperty("glide.servlet.uri") + 'nav_to.do?uri=incident.do?sys_id='+inc.sys_id+'%26sysparm_view=ess'; //Here the ess view is used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 02:02 AM
Hello Mguy,
In the created I want to show the incident number as a link.Here the URL is coming correctly.
Any way to show this url to as Incident number
gs.include("FormInfoHeader");
var fi = new FormInfoHeader();
var number1=inc.number;
var url = gs.getProperty("glide.servlet.uri") + '/bdc?id=form&table=incident&sys_id='+inc.sys_id+'&view=ess';
var s = 'Thanks! Incident number ' + url+ ' has been created! The Support Team will address the issue and contact you if needed. You will need this ticket number for tracking purposes.<br/>';
fi.addMessage(s);
return inc.sys_id;
},