You need to sign in to do that
Don't have an account?
matt lieber 5
Trigger giving compile error on referencing standard field on standard object
hi,
my trigger and the problem is as such:
Not understanding the error; 'Body' is a standard field on FeedItem, according to this :
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feeditem.htm
So what's the problem ?
thanks!
Matt
my trigger and the problem is as such:
Not understanding the error; 'Body' is a standard field on FeedItem, according to this :
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feeditem.htm
So what's the problem ?
thanks!
Matt
replace you code
comment.FeedCommentBody__c=feed.Body;
with
comment.FeedCommentBody__c=feed.CommentBody;
Note: You are referring FeedItem in the link you posted, but I see in your code you have FeedComment
Please refer link below
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feedcomment.htm
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya
All Answers
replace you code
comment.FeedCommentBody__c=feed.Body;
with
comment.FeedCommentBody__c=feed.CommentBody;
Note: You are referring FeedItem in the link you posted, but I see in your code you have FeedComment
Please refer link below
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feedcomment.htm
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya
Hi,
Yes.
'Body' is a standard field on FeedItem.
But in above code you triggered on "feedcomment" Object So need to use "CommentBody" field.
As Sandhya referred, CommentBody is a standard field of "FeedComment" object and Body is a standard field of "FeedItem" object.
And in your trigger, you are referring to the FeedComment object hence, replace your code "feed.CommentBody"
Kindly check the below links for more details:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feeditem.htm
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feedcomment.htm
Hope this helps you!
Best Regards,
Deepthi