+ Reply to Thread
Results 1 to 2 of 2
This is a discussion on Batch Processing type error within the Salesforce Coding Discussions forums, part of the Salesforce category; This is pretty basic but I'm stuck and could use a fresh
  1. #1
    Jessie Rawlins is offline Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Batch Processing type error

    This is pretty basic but I'm stuck and could use a fresh pair of eyes or two. I'm trying to batch process an upsert. Here is my code:

    Code:
    foreach ($CreateSO as $num => $MPId) {
            foreach ($list as $cont) {
                if ($MPId == $cont->Id) {
       $fields = array (
        'Payment_Status__c' => $Status
      );
    
      $sObject = new SObject();
      $sObject->fields = $fields;
      $sObject->type = 'Monthly_Program__c';
      $sObject->Id = $MPId;
      array_push($sObjects, $sObject)
    }}}
    $Response = $mySforceConnection->update(array($sObjects));
    print_r($sObjects);
    I'm getting a fatal error regarding the type

    Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'type' property in /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/SforceBaseClient.php:414 Stack trace: #0 /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/SforceBaseClient.php(414): SoapClient->__call('update', Array) #1 /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/SforceBaseClient.php(414): SoapClient->update(Object(stdClass)) #2 /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/SforcePartnerClient.php(128): SforceBaseClient->_update(Object(stdClass)) #3 /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/StatusUpdate.php(118): SforcePartnerClient->update(Array) #4 {main} thrown in /home/content/81/5958681/html/independentlivingbullion/sandbox/monthlyprogram/SforceBaseClient.php on line 414

    Here is the print_r results:
    Array ( [0] => SObject Object ( [type] => Monthly_Program__c [fields] => Array ( [Payment_Status__c] => Cleared ) [Id] => a0x30000000aMk5AAE ) )

    I've been staring at this for hours and just can't figure out why it is not seeing the type.

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    replace this line:

    PHP Code:
    $Response $mySforceConnection->update(array($sObjects)); 
    WITH THIS:

    PHP Code:
    $Response $mySforceConnection->update($sObjects); 

+ Reply to Thread

Similar Threads

  1. Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from
    By monloi in forum Salesforce Coding Discussions
    Replies: 2
    Last Post: 02-18-2009, 07:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2