-
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
What is Salesforce: An Ultimate Guide To Salesforce
Cloud Computing Technologies has expanded in popularity in recent years. Salesforce is one such technology that has had a profound effect on the world of…
Managed and Unmanaged packages in Salesforce in 2023 | All You Need to Know
What are the various types of packages in Salesforce? Let's understand! Unmanaged Package Think of it as a beautifully wrapped gift box that you can…
How to Create User in Salesforce | The Developer Guide
Introduction: A user is a person who has credentials to login into Salesforce and is able to use the assigned application in Salesforce. The user…
Popular Salesforce Videos
Access & Permissions in Salesforce | Profiles, Permission Sets, Sharing Settings
User permissions and access settings specify what users can do within an organization: Permissions determine a user's ability to edit an object record, view the…
Lead Process in Salesforce | How To Manage Leads in Salesforce Sales Cloud?
Leads are potential customers who have expressed interest in your product or service but haven't made a purchase yet. They're like the starting point of…
What are Salesforce Developer Edition?
Salesforce Developer Account is actually a free of cost account. If you wanted to explore and if you wanted to do the configuration practices or…