function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hermann Oure 6Hermann Oure 6 

Mass update failure: owner or user is inactive

Hello,

I am trying to update the value of a custom field on all cases that counts the number of interactions (FeedItem =='textPost') with clients.
Everything works fine on the sandbox but when trying to replicate the query on Prod.
I have the following error:
User-added imageHere is my query on the anonymous window
update [SELECT id FROM FeedItem WHERE type = 'textPost' LIMIT 10000];

How can I solved this issue?
Thanks

Please see also my trigger:
trigger FeedItemTrigger on FeedItem (after insert, after update, before delete) {
    if(Trigger.isAfter){
        if(Trigger.isInsert || Trigger.isUpdate){
          List<FeedItem> caseFeedItems = new  List<FeedItem>();
            for(feedItem f: trigger.new) {
                if(String.valueOf(f.parentId).startsWith('500')){
                    caseFeedItems.add(f);
                }
            } 
            if(caseFeedItems.size()>0)FeedItemTriggerHandler.countFeedItem(caseFeedItems);    
        }
    } else if(Trigger.isBefore){
      if(Trigger.isDelete){
          List<FeedItem> caseFeedItems = new List<FeedItem>();
          for(feedItem f: trigger.old) {
              if(String.valueOf(f.ParentId).StartsWith('500'))
                  caseFeedItems.add(f);
          }   
        }
    }
}


 
ShirishaShirisha (Salesforce Developers) 
Hi Hermann,

Greetings!

Seems like you are trying to update one of the Feeditem to the inactive user.So,can you please try to capture the debug logs when you are trying to run the query in anonymous window to see the UserId.Otherwise,you can just try to access the FeedIteam and check for the user to see,if it is inactive.

If yes,please change the user to someother who is active to resolve the issue.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri