• spatelce
  • NEWBIE
  • 100 Points
  • Member since 2013

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

Hi, 

I am looking to send trigger a chatter alert in a group when an opportunity is changed to Closed Won. We are currently using email alerts (AND( ISCHANGED(StageName), Probability = 1, NOT(Owner.Id = "005d0000001TUC8")) but would like to move the interaction to chatter: 

 

Below is my attempt but

 

1. When I try this I get the error - Compile Error: unexpected token: insert at line 26 column 8 

2.As it is in the workflow - I would like to have one person's opportunitiy's (NOT(Owner.Id = 005d0000001TUC8) not trigger this workflow for privacy reasons

 

Could anyone help me clean this up? Thank you so much!

 

trigger ChatterWonOpportunity on Opportunity (after insert, after update) {

String status;
String OppAccName;
//Decimal OppAmount;
FeedItem post = new FeedItem();
    
    for(Opportunity o : Trigger.new) {
        if(Trigger.isInsert) {
                               if(o.IsWon == true && Trigger.oldMap.get(o.id).IsWon == false) {
                    for (Opportunity oppty : [SELECT Account.Name FROM Opportunity WHERE Id =:o.Id] ) {
                        OppAccName = oppty.Account.Name;
                    }
                   o.owner +' just won' + OppAccName + 'for' o.expectedrevenue + ‘!';
                    }
                    else {
                        return;
                    }
                }
            
            post.ParentId = //0F9K000000005LR
            post.Title = o.Name;
            post.Body = status;
            }
        }
        insert post;
    }
}

 

  • August 06, 2013
  • Like
  • 0

I want to make a chatter post but link a salesforce object to it. I am new to salesforce development and really new to chatter development so if anyone could help me out that would be great thanks

When I retrieve data for Chatter I do not get data on any files/images attached to a comment.

 

I get

 

parent {id  and url}
id
clientinfo
user{name, title,companyName, firstName, lastName,mySubscription, isChatterGuest, photo (large and small}, id, url, type}
body{text, messageSegments}, feedItem, deletable, url, createdDate

 

 

Am I missing something or is this by design?

  • December 06, 2013
  • Like
  • 0

Does anyone know if there is a workflow rule or trigger rule I can create to post an update (that includes multiple fields) to a chatter group when an account field has been changed?

 

Thank you

  • November 12, 2013
  • Like
  • 0

Hi,

 

Is there a way or an example chatter post with attachment in JSON using base64 encoding?

 

Thank you!

  • September 04, 2013
  • Like
  • 0

For some reason in the Developer Console the Tests tab seems to stop displaying new test results after 4 runs.  Anyone else noticed the problem?  I'm wondering if there's a menu entry somewhere that lets me to clear the tab, but not finding any.  It'd be handy not just for when it's stuck, but also when my result list grows too long.  Any suggestion is appreciated.

Does a user need administrator privileges to install the force.com ide on a windows machine?  I need to visit a site and use one of their machines to access their SFDC org (security protocol), and they are asking what is required to install the IDE.

 

 

Hi, 

I am looking to send trigger a chatter alert in a group when an opportunity is changed to Closed Won. We are currently using email alerts (AND( ISCHANGED(StageName), Probability = 1, NOT(Owner.Id = "005d0000001TUC8")) but would like to move the interaction to chatter: 

 

Below is my attempt but

 

1. When I try this I get the error - Compile Error: unexpected token: insert at line 26 column 8 

2.As it is in the workflow - I would like to have one person's opportunitiy's (NOT(Owner.Id = 005d0000001TUC8) not trigger this workflow for privacy reasons

 

Could anyone help me clean this up? Thank you so much!

 

trigger ChatterWonOpportunity on Opportunity (after insert, after update) {

String status;
String OppAccName;
//Decimal OppAmount;
FeedItem post = new FeedItem();
    
    for(Opportunity o : Trigger.new) {
        if(Trigger.isInsert) {
                               if(o.IsWon == true && Trigger.oldMap.get(o.id).IsWon == false) {
                    for (Opportunity oppty : [SELECT Account.Name FROM Opportunity WHERE Id =:o.Id] ) {
                        OppAccName = oppty.Account.Name;
                    }
                   o.owner +' just won' + OppAccName + 'for' o.expectedrevenue + ‘!';
                    }
                    else {
                        return;
                    }
                }
            
            post.ParentId = //0F9K000000005LR
            post.Title = o.Name;
            post.Body = status;
            }
        }
        insert post;
    }
}

 

  • August 06, 2013
  • Like
  • 0

Trying to create an apex trigger to automatically post a case with a particular severity level to a Chatter group.  Could someone get me started?

  • August 02, 2013
  • Like
  • 0

I got production, fullcopy sandbox.

 

I created users in production and created full copy sandbox and then created territory hiererchy in Production..

 

Now when i see in production I can see User,territory in production and only users in Fullcopy sandbox.

 

 

Now  need to create account fields,custom object,account data..where should I do..?

I am confused what to do with territory that i created in production.

I need to get in Full copy..If not possible , what is the best practices from nowonwards...

I want to make a chatter post but link a salesforce object to it. I am new to salesforce development and really new to chatter development so if anyone could help me out that would be great thanks

I'm trying to get a pageblock to show like a standard related list with the icon for the object the pageblock will display.  If I set the tabStyle attribute of the pageBlock to the object it changes the border colors but does not display the icon.  How can I display the object icon too?