Activity Forums Salesforce® Discussions How can we post message along with some fields to yammer user profile when opportunity is created?

  • How can we post message along with some fields to yammer user profile when opportunity is created?

    Posted by Malhari on March 15, 2018 at 6:12 am

    Hi All,

    As I am a newbie in salesforce, need some advice on API callout. I am doing a POC to integrate Salesforce with yammer. I am wondering, how can we post a message on yammer when opportunity or task is created. Along with message need to pass some fields with their value which will add some meaning to that message.

    If an opportunity is created we would like to post a message on user profile in yammer says that Opportunity owner XYZ has created ABC opportunity and the amount is X, which means to send some field along with the message.

    It would be so great of you if you help me out with this.

    Thanks in advance,

    Malhari.

    Malhari replied 6 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Subhendu

    Member
    March 16, 2018 at 1:55 pm

    Hi Malhari,

    You can do this is following way:

    • Have a util class with a future method in it with the param String to be sent. This future method will be making API callouts to Yammer for posting the message.
    • Have insert triggers on Opportunity as well as Task.
    • In both the triggers, get the values to send in the message and create a string, call the future method from util class and pass the message String.
    • Make API callouts in the future method as Salesforce does not allows making API callouts in the same transaction of Trigger.

    Thanks,

    Subhendu

  • Malhari

    Member
    March 19, 2018 at 4:03 am

    Thanks... Will check and let you know if it works or not.

  • Malhari

    Member
    March 20, 2018 at 5:24 am

    hey .. it worked..thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos