• Richard Houston 28
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

I've enabled all users to automatically follow the items they create in chatter. However, it looks like files that are created when attaching records through Lightnig for Outlook also get followed. Because of this there are some users that are quickly approaching the 500 record limit. 

How can I stop users from following new files, or use the app Chatter Unfollow Rules to unsubscribe them immediately? I can't figure out which object I can reference using the app.
 

Thanks! 

Hi,

I need to notify account owners when a task is created on an account that they own when they are not the assigned to of the task. I'm running into trouble querying the account owner ID from the trigger. Here's the code I'm currently trying:
 
trigger accountOnwerChatterUpdate on Task (after insert) {
    list <FeedItem> chatterPosttoAdd = new List <FeedItem>();
    Set<ID> ids = Trigger.newmap.keyset();
    system.debug(ids);
  
    for(Task t : trigger.new ){
        
        system.debug(t.WhatID);
        system.debug(t.ownerid);
        system.debug(t.account.ownerid);
        //if statement to check if the assigned to id is different from the account ownerID
        IF(t.OwnerId == t.account.ownerid){
            FeedItem accountPost = New FeedItem();
            accountpost.ParentID = t.accountid ;
            accountpost.Body = t.CreatedBy +' created a new activity with the subject ' + t.Subject;
            chatterPosttoAdd.add(accountpost);
        }
    }
insert chatterPosttoAdd;
}

It's referenced from this help article : https://help.salesforce.com/HTViewSolution?id=000003788&language=en_US

When I create a task and look at the debug logs t.account.ownerid returns null. Any thoughts on how to get that value to reutrn the account owner?

Thanks so much!

I've enabled all users to automatically follow the items they create in chatter. However, it looks like files that are created when attaching records through Lightnig for Outlook also get followed. Because of this there are some users that are quickly approaching the 500 record limit. 

How can I stop users from following new files, or use the app Chatter Unfollow Rules to unsubscribe them immediately? I can't figure out which object I can reference using the app.
 

Thanks! 

Hi,

I need to notify account owners when a task is created on an account that they own when they are not the assigned to of the task. I'm running into trouble querying the account owner ID from the trigger. Here's the code I'm currently trying:
 
trigger accountOnwerChatterUpdate on Task (after insert) {
    list <FeedItem> chatterPosttoAdd = new List <FeedItem>();
    Set<ID> ids = Trigger.newmap.keyset();
    system.debug(ids);
  
    for(Task t : trigger.new ){
        
        system.debug(t.WhatID);
        system.debug(t.ownerid);
        system.debug(t.account.ownerid);
        //if statement to check if the assigned to id is different from the account ownerID
        IF(t.OwnerId == t.account.ownerid){
            FeedItem accountPost = New FeedItem();
            accountpost.ParentID = t.accountid ;
            accountpost.Body = t.CreatedBy +' created a new activity with the subject ' + t.Subject;
            chatterPosttoAdd.add(accountpost);
        }
    }
insert chatterPosttoAdd;
}

It's referenced from this help article : https://help.salesforce.com/HTViewSolution?id=000003788&language=en_US

When I create a task and look at the debug logs t.account.ownerid returns null. Any thoughts on how to get that value to reutrn the account owner?

Thanks so much!