You need to sign in to do that
Don't have an account?
Dan Dodd 3
upload a file that belongs to a case
I am uploading case history to out new salesforce Helpdesk.
We are receiving new cases via the Email-to-case method.
When a case is created by email-to-case an attachment is saved as a file connected to the case.
I am able to upload the case history via the API but I dont see how to pass a filename and get the file unloaded and attached.
We are receiving new cases via the Email-to-case method.
When a case is created by email-to-case an attachment is saved as a file connected to the case.
I am able to upload the case history via the API but I dont see how to pass a filename and get the file unloaded and attached.
You can try utilizing the name field in Attachment object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
Attachment attachment = new Attachment();
attachment.Body = Blob.valueOf(encodedContentsString);
attachment.Name = String.valueOf('test.txt');
attachment.ParentId = accountId;
insert attachment;
For EmailFileAttachment, there is filename field
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_attachment.htm
Anudeep
Is it possible I need to use a Fies API endpoint and not attachment?
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentversion.htm?search_text=file