You need to sign in to do that
Don't have an account?
KitagawaSan85
Attempt to de-reference a null object
I am working on a controller extention to create some values for a visualforce page but and running into an issue when trying to count the number of chatter posts for a given account hierarchy that have a certain tag.
I can get it to return the total feeditems for an account using an SOQL query, but run into an issue when I try to pull in the feeds for multiple accounts using 'WHERE ParentID IN :ListOfAccounts'.
Can anybody see if I am missing something?
List<FeedItem> Chatters = new List<FeedItem>();{ for(FeedItem FI : [SELECT ID,body from FeedItem]) { if(FI.Body.contains('#CRTNEWS')) { Chatters.add(FI); }}} List<account> accts = [SELECT Id FROM Account WHERE NA_Code_EU__c = :acc.NA_Code_EU__c]; public integer getChatter() { return [SELECT count() FROM AccountFeed WHERE ParentID IN :accts AND ID IN:Chatters]; }
Was able to modify to this:
which works...
All Answers
turn the List<FeedItem> Chatters to List<ID> Chatters or Set<Id>
add only Id field to this List or Set
Thanks, but that didnt seem to help.
Still returns a null object error.
Was able to modify to this:
which works...