Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. stdClass Object
  2. (
  3. [errors] => Array
  4. (
  5. [0] => stdClass Object
  6. (
  7. [fields] => Array
  8. (
  9. [0] => ShippingStreet
  10. )
  11.  
  12. [message] => Please enter the FULL Shipping Address for this Account
  13. [statusCode] => FIELD_CUSTOM_VALIDATION_EXCEPTION
  14. )
  15.  
  16. )
  17.  
  18. [id] =>
  19. [success] =>
  20. )
  21.  
  22. SoapFault Object
  23. (
  24. [message:protected] => INVALID_FIELD: No such column 'ShippingStreet' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
  25. [string:Exception:private] =>
  26. [code:protected] => 0
  27. [file:protected] => C:wampwwwcheckoutsalesforcesoapclientSforceBaseClient.php
  28. [line:protected] => 514
  29. [trace:Exception:private] => Array
  30. (
  31. [0] => Array
  32. (
  33. [file] => C:wampwwwcheckoutsalesforcesoapclientSforceBaseClient.php
  34. [line] => 514
  35. [function] => __call
  36. [class] => SoapClient
  37. [type] => ->
  38. [args] => Array
  39. (
  40. [0] => update
  41. [1] => Array
  42. (
  43. [0] => stdClass Object
  44. (
  45. [sObjects] => Array
  46. (
  47. [0] => SoapVar Object
  48. (
  49. [enc_type] => 301
  50. [enc_value] => stdClass Object
  51. (
  52. [Id] => xxxxREMOVED_IDxxxxxx
  53. [StageName] => Closed Won
  54. [CloseDate] => 2016-01-08
  55. [LeadSource] => Self-Service
  56. [Type] => New Business
  57. [Amount] => 6000
  58. [ShippingStreet] => 123 Test St
  59. )
  60.  
  61. [enc_stype] => Opportunity
  62. [enc_ns] => urn:enterprise.soap.sforce.com
  63. )
  64.  
  65. )
  66.  
  67. )
  68.  
  69. )
  70.  
  71. )
  72.  
  73. )
  74.  
  75. define("SOAP_CLIENT_BASEDIR", "salesforce/soapclient");
  76. require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
  77. require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');
  78.  
  79.  
  80. $USERNAME="xxxxxxx";
  81. $PASSWORD="xxxxxxxxxxxxxxxxxxxxxxxxxxx";
  82.  
  83. $sObject = new stdClass();
  84. $sObject->Id = $_SESSION['user']['sf_opportunityID'];
  85. //$sObject->AccountId = $_SESSION['user']['sf_accountID']; tried with and without this
  86. $sObject->StageName = 'Closed Won';
  87. $sObject->CloseDate = date('Y-m-d');
  88. $sObject->LeadSource = 'Self-Service';
  89. $sObject->Type = 'New Business';
  90. $sObject->Amount = 6000;
  91. $sObject->ShippingStreet = '123 Test St';
  92. $opportunityUpdateArray = array($sObject);
  93.  
  94.  
  95. try {
  96. $mySforceConnection = new SforceEnterpriseClient();
  97.  
  98. $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
  99. $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
  100.  
  101. $updateOpportunityResponse = $mySforceConnection->update($opportunityUpdateArray, 'Opportunity');
  102.  
  103. }catch (Exception $e) {
  104. echo $e->faultstring;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement