Skip to main content
11 events
when toggle format what by license comment
Jun 9, 2017 at 13:35 comment added sfdcfox @Konstantine It's okay. Things like that happen all the time. Glad I could help.
Jun 9, 2017 at 13:32 comment added PentaKon I was stupid and wasn't correctly removing the parentId from the body.
Jun 9, 2017 at 13:30 vote accept PentaKon
Jun 9, 2017 at 13:16 comment added PentaKon Let us continue this discussion in chat.
Jun 9, 2017 at 13:07 comment added sfdcfox @Konstantine you need to create a multipart body, as outlined in the documentation. You can't send a raw body by itself.
Jun 9, 2017 at 13:00 comment added PentaKon I have the attachment ID but you said I cannot use it. As explained in my question the only thing I'm doing is creating an XHR object with the given url (which contains the attachmentID) and setting the body as the new binary object. I'm not using any apex or salesforce specific stuff, I just want to use the REST Api. What should I do, because just calling that URL with a PATCH method doesn't seem to work...
Jun 9, 2017 at 12:57 comment added sfdcfox @Konstantine You need the attachment Id. You're not going to get around that.
Jun 9, 2017 at 12:49 comment added PentaKon I don't think that's going to work. Inside the visual force page, I download the attachment's body as a blob and show it in my application. The page itself has no knowledge of the attachmentId used so how will it know which attachment to update?
Jun 9, 2017 at 12:47 comment added sfdcfox @Konstantine Use the patch method described in the document I linked (which I suspect you're already doing), but do not specify a ParentId.
Jun 9, 2017 at 12:46 comment added PentaKon How can I update an existing attachment's body then?
Jun 9, 2017 at 12:33 history answered sfdcfox CC BY-SA 3.0