Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Do you have an example of php code I can used to update the chatter current status ?
Thank you !
Just figured it out. I was using an old version of the partner WSDL file (pre-Chatter). Update it to the current one and it should work!
This code is wrong:
$mySforceConnection = new SforcePartnerClient(); $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml'); $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD); $fieldsToUpdate = new DOMDocument('1.0', 'iso-8859-1');
$statusElement=$fieldsToUpdate->createElement("CurrentStatus","hello world from php"); $fieldsToUpdate->appendChild($statusElement); $UPDATEOBJECTID="XXXXXXXXXXXXXXXXXX"; $sObject = new SObject(); $fieldsToUpdate = array ('CurrentStatus' => 'Hello world'); $sObject->type = 'User'; $sObject->Id = $UPDATEOBJECTID; $sObject->fields=$fieldsToUpdate; $response = $mySforceConnection->update(array ($sObject)); print_r($response);
This is the message: stdClass Object ( [errors] => stdClass Object ( [fields] => CurrentStatus [message] => User: bad field names on insert/update call: CurrentStatus [statusCode] => INVALID_FIELD_FOR_INSERT_UPDATE ) [id] => [success] => )
Do you have an idea ?
(It come from the sample in c#)
I'm getting the same thing.
No idea why that's considered an invalid field for update...
Anyone have an idea?
It don't work for me , do you have an exemple ?
I have the same error for the moment
Just figured it out. I was using an old version of the partner WSDL file (pre-Chatter). Update it to the current one and it should work!
All Answers
This code is wrong:
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
$mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
$fieldsToUpdate = new DOMDocument('1.0', 'iso-8859-1');
$statusElement=$fieldsToUpdate->createElement("CurrentStatus","hello world from php");
$fieldsToUpdate->appendChild($statusElement);
$UPDATEOBJECTID="XXXXXXXXXXXXXXXXXX";
$sObject = new SObject();
$fieldsToUpdate = array ('CurrentStatus' => 'Hello world');
$sObject->type = 'User';
$sObject->Id = $UPDATEOBJECTID;
$sObject->fields=$fieldsToUpdate;
$response = $mySforceConnection->update(array ($sObject));
print_r($response);
This is the message: stdClass Object ( [errors] => stdClass Object ( [fields] => CurrentStatus [message] => User: bad field names on insert/update call: CurrentStatus [statusCode] => INVALID_FIELD_FOR_INSERT_UPDATE ) [id] => [success] => )
Do you have an idea ?
(It come from the sample in c#)
Thank you !
I'm getting the same thing.
No idea why that's considered an invalid field for update...
Anyone have an idea?
Just figured it out. I was using an old version of the partner WSDL file (pre-Chatter). Update it to the current one and it should work!
It don't work for me , do you have an exemple ?
I have the same error for the moment