Any workaround for GlideSysAttachment() in scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 03:15 AM
Hi All,
It seems 'GlideSysAttachment()' is not supported in the scoped application. So is there any workaround for this exist? I am on Fuji release patch 6.
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 03:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 04:21 AM
Thanks for your reply but this doesn't solve my issue (thread only talks about the copying of attachment it seems). Basically I need to use 'GlideSysAttachment' in one of my web services call to send attachment like this:
var sysAttachment = new GlideRecord('sys_attachment')
// some code goes here
var attachPackage = GlideSysAttachment(); // This doesn't work in scoped application hence need replacement of the same
var bytes = attachPackage.getBytes(sysAttachment);
// some code goes here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 01:13 AM
I am having the same problem with my scoped application. Mukesh please post solution if you have already found one. I am using below code.
var attach = new GlideSysAttachment();
var id = attach.write(mapSet, fileName, 'application/json', body);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 03:46 AM
I haven't found any solution of this as of now. I strongly feel that 'ServiceNow' should remove restrictions from the APIs for scope applications, as its really painful to work with scope application with such restrictions !!