Post a Batch of Feed Elements with a New (Binary) File
Use a trigger to call a method to bulk post a new file to the feeds of accounts.
This example is valid in version 32.0–35.0. In version 36.0 and later, you can’t post a batch of feed elements with a new file in the same call. Upload the file to Salesforce first, and then specify the uploaded file when posting a batch of feed elements.
This trigger calls postFeedElementBatch(communityId, feedElements) to bulk post to the feeds of newly inserted accounts. Each post has a new file (binary) attachment.