- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 02:58 AM
HI,
I am trying to create a UI Action that takes the info from a Facilities Request and copies that into an incident. I have most of it working except the copying of any attachments, what am I doing wrong?
I am a complete novice at this and have completely hashed this together!!
Any help is most appreciated!
Matt
var fac = new GlideRecord("incident");
GlideSysAttachment.copy('facilities_request', current.sys.id, 'incident', current.sys_id);
fac.short_description = "Created from Facitlities Record " + current.number + ": " + current.short_description;
fac.caller_id = current.opened_for;
var sysID = fac.insert();
current.u_reference = sysID;
var mySysID = current.update();
gs.addInfoMessage("Incident " + fac.number + " created for this Facilities Record");
action.setRedirectURL(facilities_request);
action.setReturnURL(current);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 03:58 AM
Hi Matt,
Updated the script. Can you copy my script above again and try it now .
Basically there was mistake in current.sys.id and it should be current.sys_id

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 03:58 AM
Hi Matt,
Updated the script. Can you copy my script above again and try it now .
Basically there was mistake in current.sys.id and it should be current.sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 04:59 AM
perfect- works like a treat! thanks you so much for your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 05:02 AM
Great
I am glad I can be helpful to you