• Venkat R. Bade
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
The initial idea was to block all chatter feed from external batch jobs which run nightly. We had a trigger do it.
trigger PreventPost on FeedItem (before insert) {
    if(UserInfo.getProfileId() == '00eo0000000U2if') //User Account Profile ID used for running batch jobs
    {       
        for(feedItem tmp : trigger.new){           
                tmp.addError('API Unable to Post');
            }
        }
    }

It was simple and very efficient until the scheduled batch jobs ran. The trigger could not prevent the scheduled batch jobs from posting chatter feed into accounts. Upon further investigation, we found out that scheduled batch jobs run as a system and that might be the reason.
Any ideas on if we can delete the feed after its posted or have a way to prevent it from getting posted. 
I have created vf pages for a bunch of related lists so they can be moved around in the page layout. But the create "new" button on top of the page when clicked opens up the page within the vf page in the page layout section. How can I make it open in a new window? User-added imageUser-added imageThis is the vf page for the related listUser-added imageUser-added imageThis is the vf page related list.
The initial idea was to block all chatter feed from external batch jobs which run nightly. We had a trigger do it.
trigger PreventPost on FeedItem (before insert) {
    if(UserInfo.getProfileId() == '00eo0000000U2if') //User Account Profile ID used for running batch jobs
    {       
        for(feedItem tmp : trigger.new){           
                tmp.addError('API Unable to Post');
            }
        }
    }

It was simple and very efficient until the scheduled batch jobs ran. The trigger could not prevent the scheduled batch jobs from posting chatter feed into accounts. Upon further investigation, we found out that scheduled batch jobs run as a system and that might be the reason.
Any ideas on if we can delete the feed after its posted or have a way to prevent it from getting posted.