• Java_Chatter_Integration
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi Folks,

 

I need to post a feed to chatter's account , contact etc using java.

Below is my code:-

 

SObject user = new SObject();
user.setType("user");
 user.setId(connection.getUserInfo().getUserId());
 user.setField("currentStatus", in.readLine());
 SaveResult[] results = connection.update(new SObject[] { user });

 

Above code works , if we need to post a feed to chatter.

 

I am trying to modify the code:-

SObject user = new SObject();
user.setType("Account"); // This the type called Account , because i need to post my feed to account object.
user.setId("0019000000BJlvz");  // This is the parent ID of my account.
user.setField("currentStatus", in.readLine()); // This is invalid field , because we don't have any field called currentStatus in account object.
SaveResult[] results = connection.update(new SObject[] { user });

 

So if i run the above code , i gets No Column exits for Account entity exception.

 

Is there a way to post our feeds directly to account object using java.

 

Your help is really appreaciated.

 

Thanks,

Harsha.