-
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
Flow Builder and Approval Process in Salesforce
Flow Builder is the interface where Flows can be designed and tested. The below screenshot shows the Flow builder screen, and the following table explains…
How Salesforce IoT Cloud Prove to be Beneficial for Your Business
The term, Internet of Things (IoT), is a system of connected computing devices, such as mobiles, digital machines, and other objects with the potential of…
Popular Salesforce Videos
Create Custom Object and Tabs in Salesforce Lightning Experience
In this video, Sanjay Gupta Tech School explains how to create custom objects and tabs in Salesforce Lightning Experience. Watch this video and learn all…
What is Workflow Rule in Salesforce | Salesforce Interview Questions and Answers
What is Workflow Rule in Salesforce | Salesforce Interview Questions and Answers
GS DevOps Mate: Your Free Flexible Toolkit for Faster and Smoother Salesforce Deployments
Are you considering automated Salesforce deployments based on repos? Or are you struggling with setting up CI/CD utilizing SFDX on the CI/CD platform of your…