• aleksh
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm using PHP 5.1.2 with the php5-1.0.3 salesforce package and trying to update a field on a custom object that is a reference to a contact object:-

<?

require_once('soapclient/SforcePartnerClient.php');
require_once('soapclient/SforceHeaderOptions.php');

$sfcon = new SforcePartnerClient();

$soap = $sfcon->createConnection("partner.wsdl.xml");

$login = $sfcon->login("user@domain.com", "password");

$card_id = "x099000000099xxYYY";
$contact_id = "00990000009Yx9YYYY";

$fields = array
(
  "Id"=>$card_id,
  "Contact__c"=>$contact_id,
  "Status__c"=>"Active",
  "Pass_to_CA_System__c"=>true
);

$sobj = new SObject();

$sobj->fields = $fields;

$sobj->type = "CA_Card__c";

$card = $sfcon->update(array ($sobj));

?>

and I get the following error:-

Fatal error: Uncaught SoapFault exception: [soapenv:Server] org.xml.sax.SAXException: Could not find deserializer for field: Contact__c of type {urn:enterprise.soap.sforce.com}ID in /www/dev/salesforce/soapclient/SforceBaseClient.php:554 Stack trace: #0 [internal function]: SoapClient->__call('update', Array) #1 /www/dev/salesforce/soapclient/SforceBaseClient.php(554): SoapClient->update(Object(stdClass)) #2 /www/dev/salesforce/test005.php(29): SforceBaseClient->update(Array) #3 {main} thrown in /www/dev/salesforce/soapclient/SforceBaseClient.php on line 554

Contact__c is a reference to a contact record. (details from describe is at bottom of post)

If I comment out the "Contact__c"=>$contact_id, line, the record is updated...

what am I doing wrong?

Does the absence of a value for the "updateable" field indicate I don't have permission to update this field? and if yes, should this not return a different error?

info from describe:-

            [12] => stdClass Object
(
[autoNumber] =>
[byteLength] => 18
[calculated] =>
[createable] =>
[custom] => 1
[defaultedOnCreate] =>
[digits] => 0
[filterable] => 1
[label] => Contact
[length] => 18
[name] => Contact__c
[nameField] =>
[nillable] => 1
[picklistValues] =>
[precision] => 0
[referenceTo] => Contact
[restrictedPicklist] =>
[scale] => 0
[soapType] => tns:ID
[type] => reference
[updateable] =>
)

I'm using PHP 5.1.2 with the php5-1.0.3 salesforce package and trying to update a field on a custom object that is a reference to a contact object:-

<?

require_once('soapclient/SforcePartnerClient.php');
require_once('soapclient/SforceHeaderOptions.php');

$sfcon = new SforcePartnerClient();

$soap = $sfcon->createConnection("partner.wsdl.xml");

$login = $sfcon->login("user@domain.com", "password");

$card_id = "x099000000099xxYYY";
$contact_id = "00990000009Yx9YYYY";

$fields = array
(
  "Id"=>$card_id,
  "Contact__c"=>$contact_id,
  "Status__c"=>"Active",
  "Pass_to_CA_System__c"=>true
);

$sobj = new SObject();

$sobj->fields = $fields;

$sobj->type = "CA_Card__c";

$card = $sfcon->update(array ($sobj));

?>

and I get the following error:-

Fatal error: Uncaught SoapFault exception: [soapenv:Server] org.xml.sax.SAXException: Could not find deserializer for field: Contact__c of type {urn:enterprise.soap.sforce.com}ID in /www/dev/salesforce/soapclient/SforceBaseClient.php:554 Stack trace: #0 [internal function]: SoapClient->__call('update', Array) #1 /www/dev/salesforce/soapclient/SforceBaseClient.php(554): SoapClient->update(Object(stdClass)) #2 /www/dev/salesforce/test005.php(29): SforceBaseClient->update(Array) #3 {main} thrown in /www/dev/salesforce/soapclient/SforceBaseClient.php on line 554

Contact__c is a reference to a contact record. (details from describe is at bottom of post)

If I comment out the "Contact__c"=>$contact_id, line, the record is updated...

what am I doing wrong?

Does the absence of a value for the "updateable" field indicate I don't have permission to update this field? and if yes, should this not return a different error?

info from describe:-

            [12] => stdClass Object
(
[autoNumber] =>
[byteLength] => 18
[calculated] =>
[createable] =>
[custom] => 1
[defaultedOnCreate] =>
[digits] => 0
[filterable] => 1
[label] => Contact
[length] => 18
[name] => Contact__c
[nameField] =>
[nillable] => 1
[picklistValues] =>
[precision] => 0
[referenceTo] => Contact
[restrictedPicklist] =>
[scale] => 0
[soapType] => tns:ID
[type] => reference
[updateable] =>
)