save xml as attachment ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2013 03:01 AM
hi there!
any pointers to store the xml of current record as a related attachment record in attachments table ?
cheers!
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2013 04:22 AM
There is actually a very simple way, Here is the way you can do it:
var xml = '<xml>'+
'<number>'+current.number+'</number>'+
'<state>'+current.state+'</state>'+
'</xml>';
var attachment = new Attachment();
var attachmentRec = attachment.write('incident', current.sys_id, "record.xml", "text/xml", xml);
gs.addInfoMessage('An attachment is created with sys_id and attached to this incident'+ attachmentRec);
This is the idea.