• KymLe
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I have quite a few triggers in my org that fire based on insert and/or update and execute a variety of business logic.  I don't particularily like this approach because 1. I'm told triggers aren't very reliable and 2. using triggers makes my application very difficult to package and reuse in a different org since there are quite a few custom objects that may/may not be relevant to another org.

Theoritically, I would like to write a "service" in which it "listens" to changes on particular objects (standard and custom).  When an insert and/or update occurs, the service then execute an apex class.  So, basically, this could be solved if Workflows were able to access Apex classes.

Is there someone out there that has a good solution for this?

Thanks for any help/ideas.
  • January 20, 2014
  • Like
  • 0

I am writing a trigger (after insert) on FeedItem.  If there's an @ mentions in the body, I need to get the User Id.  Can someone tell me how to do this?

 

Thanks in advance!

  • August 29, 2013
  • Like
  • 0
I have quite a few triggers in my org that fire based on insert and/or update and execute a variety of business logic.  I don't particularily like this approach because 1. I'm told triggers aren't very reliable and 2. using triggers makes my application very difficult to package and reuse in a different org since there are quite a few custom objects that may/may not be relevant to another org.

Theoritically, I would like to write a "service" in which it "listens" to changes on particular objects (standard and custom).  When an insert and/or update occurs, the service then execute an apex class.  So, basically, this could be solved if Workflows were able to access Apex classes.

Is there someone out there that has a good solution for this?

Thanks for any help/ideas.
  • January 20, 2014
  • Like
  • 0

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.
 

Hi,

I am trying to write a chatter trigger to repost to an account if it meets a certain criteria ?  

 

For example: if i post something aboutn # canada in my personal feed or in a group feed, it should automatically reposted to the account feed which is having account name as canada.

 

I have trigger a trigger on this.

 

trigger chatterfeed on FeedItem (after insert)
{

set<string> fbody= new set<string>();
for(feedItem f:trigger.new)
{
fbody.add(f.body);
}
List<FeedItem> feedItems = new List<FeedItem>();
list<account> a=[select id,name,ownerId from account ];

for(FeedItem f:trigger.new)
{

for(account ac:a){
if(f.body.contains(ac.name))
{
string s= f.body;
FeedItem fitem = new FeedItem();
fitem.type = 'LinkPost';
fitem.ParentId = ac.id;
system.debug(fitem.parentId+'IIIIIIIIII');
fitem.linkurl='https://ap1.salesforce.com/_ui/core/userprofile/UserProfilePage?u=00590000000NI6s&fId='+f.id;
fitem.Title = 'view';
fitem.Body=s;
system.debug(fitem.body+'BBBBBBBBB');
feedItems.add(fitem);
system.debug(feedItems+'FFFFFFFFf');
}
}
}

if(feedItems.size() > 0) {
try{
Database.insert(feedItems,false);
system.debug(feedItems+'OOOO');}
catch(exception e){}
}
}

 

I am getting internal salesforce error when I am fetching feetitem body. If I fetch feed Item id it is working fine.

 

Can anyone pls help me out its very urgent.

 

Thanks in advance.

 

 

 

  • April 08, 2013
  • Like
  • 0