Lib_Test_Enterprise_FieldsToNullTest

The Gravity Forms Salesforce Add-On Lib Test Enterprise FieldsToNullTest class.

Defined (1)

The class is defined in the following location(s).

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Enterprise/FieldsToNullTest.php  
  1. class Lib_Test_Enterprise_FieldsToNullTest extends Lib_Test_TestAbstractEnterprise 
  2. public function getTestName() 
  3. return 'FieldsToNull'; 
  4.  
  5. protected function _run() 
  6. $sObject = new stdclass(); 
  7. $sObject->FirstName = 'Mary'; 
  8. $sObject->LastName = 'Jane'; 
  9. $sObject->Phone = '510-555-5555'; 
  10.  
  11. $createResponse = $this->_mySforceConnection->create(array($sObject), 'Contact'); 
  12.  
  13. $retrieveResult= $this->_mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id); 
  14. echo "***** Before fieldsToNull\r\n"; 
  15. print_r($retrieveResult); 
  16.  
  17. $sObject = new stdclass(); 
  18. $sObject->fieldsToNull = array("Phone"); 
  19. $sObject->Id = $createResponse->id; 
  20.  
  21. $updateResult = $this->_mySforceConnection->update(array($sObject), 'Contact'); 
  22.  
  23. $queryResult = $this->_mySforceConnection->retrieve("FirstName, LastName, Phone", "Contact", $createResponse->id); 
  24. echo "***** After fieldsToNull\r\n"; 
  25. print_r($queryResult);