-
FeedItem through apexrest
When trying to create a FeedItem through the ApexRest I'm always getting the following error:
[{"errorCode":"APEX_ERROR","message":"System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Body]: [Body]\n\nClass.WS_SALES_V1_Document.post: line 61, column 1"}]
But according to the Salesforce docs, the Body field is Optional when Type is ContentPost.
Apex code of FeedItem creation(the insert fi; is line 61 by the way):FeedItem fi = new FeedItem();
fi.ParentId = o.Id;
fi.Type = 'ContentPost';
fi.Visibility = 'AllUsers';
insert fi;Is it a bug? Is documentation not up-to-date?
Log In to reply.
Popular Salesforce Blogs

How to Write About Salesforce & Cloud Computing
If you are taking an IT-related course, you will soon encounter an essay on cloud computing and Salesforce because they are the latest technologies in…

Data Import in Salesforce - A Brief Guide
If you want to import any external data into Salesforce, you can perform this activity with the help of Data Import. Data import support .csv…
Popular Salesforce Videos
How To Use Journey Builder In Salesforce Marketing Cloud | Salesforce Tutorial
How to use Journey Builder in Marketing Cloud. This video will cover the following points - 1. Introduction Get a brief introduction to Journey Builder…
Picklist fields in Salesforce Flow
In this video, we will talk about how to create picklist fields in Salesforce Screen flow. Below is the timestamp for your reference. Input Elements…
Geocoding and Reverse Geocoding in Salesforce | Google Maps APIs
In this video, you will learn to use Geocoding and Reverse Geocoding service in your Salesforce Org. Geocoding is the process of taking input text,…