Attachment API to attach file in attachment field instead of record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 12:44 AM
HI All,
I have a requirement to attach a file into custom field (type : file attachment) in a record via API. Is it possible.
Please suggest and help on this topic.
Sample
Thanks,
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 12:50 AM
Hi @guestee
what I was able to achieve is below:
1) Use Attachment API to create file -> it would create an attachment record in sys_attachment table
POST: Upload an attachment from a binary request
Gave table name as ZZ_YYtable_name; in your case it would be ZZ_YYdmn_demand
Gave the table_sys_id -> record sys_id
file name -> you want
Request body -> attachment data
2) now you will have to populate the attachment sys_id from step 1 in the field which is of type File Attachment on that record; once you update that field with that sys_id it should start showing
Reference :
Mark it as Helpful and correct if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 01:04 AM
Thanks Simran for your detailed help.
One query if we do the Point 1 , attachment will be added to the record as well (added to the record frame header) ,we dont want to show the attachment on the record header frame. Any suggestion?