How to copy attachments using Cart API method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 02:50 AM
HI,
I have a requirement to create a request using cart API. Now i able to create a request successfully but the problem is with attachments which i uploaded in SP are not getting copied on the request ticket.
Please give us the syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 02:54 AM
Hi
You can use GlideSysAttachment.copy().
GlideSysAttachment()
copy(String sourceTable, String sourceID, String targetTable, String targetID)
Copies attachments from the source record to the target record.
Regards,
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2019 10:25 PM
Hi,
below is the code which I am using in Request Record producer.
var cartId = GlideGuid.generate(null); var cart = new Cart(cartId); var item = cart.addItem('e2132865c0a8016500108d9cee411699'); var rc = cart.placeOrder();
Now please let me know how to pass parameters in Glidesysatatchment copy syntax?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2019 12:48 AM
Hi
Try with this once
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('e2132865c0a8016500108d9cee411699');
var rc = cart.placeOrder();
var attch = new GlideSysAttachment();
attach.copy("your_table_name", rc.sys_id, "target_table", rc.sys_id)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2019 01:56 AM
var attch = new GlideSysAttachment();
attach.copy('rc', 'rc.sys_id', 'sc_request', 'current.sys_id');
This is the syntax I am using. Attachments are getting copied But now the request is creating with NO ritm's
