function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ch9devch9dev 

Exception while Creating multiple SObjects

I am using php 5.12 and the newest PHP5 Toolkit 1.0.3

I am sending the following array of SObjects to a custom Table in sales force.
Code:
      Array
      (
            [0] => SObject Object
                (
                    [Id] =>
                    [type] => CUST_SALES__c
                    [fields] => Array
                        (
                            [SALES_CODE__C] => SALE
                            [INVOICE_NO__C] => 1233919
                            [INVOICE_DATE__C] => 2006-02-10T00:00:00-06:00
                            [QTY__C] => 19
                            [PRICE__C] => 19.00
                        )

                )

            [1] => SObject Object
                (
                    [Id] =>
                    [type] => CUST_SALES__c
                    [fields] => Array
                        (
                            [SALES_CODE__C] => SALE
                            [INVOICE_NO__C] => 1233929
                            [INVOICE_DATE__C] => 2006-02-11T00:00:00-06:00
                            [QTY__C] => 29
                            [PRICE__C] => gggg
                        )

                )

        ) 
The PRICE__C field in the second object is not a "xsd:double" and should throw an error, but I was hoping that it would insert the first record and return an error on the second record. Instead it just throws an exception and inserts nothing.

While this is not a huge deal with two records, I'd hate for a batch of 200 SObjects to fail to insert because one of them had an invalid type. Is this something I need to change in my table setup, or should I check all datatypes before calling create.  


 

Message Edited by ch9dev on 04-05-2006 10:12 AM

Tran ManTran Man
Since the type is incorrect, the SOAP request is invalid and will not be processed.