-
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
Automation of JSON2APEX - My journey to writing my own automated tooling for this!
Lyrics Each and every time developing an integration, I wanted to automate the most tedious and routine part of it - creating wrappers for integration…
Learn About Permission Sets in Salesforce | Salesforce Security Guide
Permissions set and Profiles in Salesforce to limit what people may access, view, and do in their Salesforce org. The permission set resembles that of…
Enhancing User Engagement with Salesforce Community Cloud
Introduction In our digital era, businesses always look for new ways to get a better user interface and build stronger relationships between their customers, partners,…
Popular Salesforce Videos
Salesforce Lightning Tutorial | Build a Custom Lightning Home Page
This Salesforce Lightning Tutorial video by Edureka will help you understand what exactly is Salesforce lightning. It will also talk about some of the features…
Understanding Future Method | Difference Between Asynchronous and Synchronous Apex in Salesforce
In this video, Shrey explained Synchronous Apex and Asynchronous Apex in a simple way. He also explained the importance of the Future method in Salesforce.…
Building a Business Case for an Investment in Salesforce - Education Cloud
Education Cloud is a leading platform that empowers your institution to become a Connected Campus, so you can transform the student journey. With the power…