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
John VaughanJohn Vaughan 

xsd:dateTime

Call to webservice at https://na17.salesforce.com/services/Soap/u/28.0/00Do0000000Zb9Z failed. Reported error:
The webservice call failed. The web service returned a SOAP Fault:
Code: soapenv:Client
Message: '02/03/2015 11:20 AM' is not a valid value for the type xsd:dateTime


I use jitterbit to get all of my order/customer data into Salesforce for CRM.

All of my OrderTime on orders read as: 12/30/1899 3:25 PM


I have been trying to fix this using CVTDate

FOrmula such as:
<trans>
CVTDate(Now(),"?m/?d/yyyy HH:MM:SS AP", "mm/dd/yyyy HH:MM AP")
</trans>


My ordertime data from my db reads as 2/3/2015 9:30:35 AM

What CVTDate line can I use that works? Ive tried like 8 ways.



 
Balaji Chowdary GarapatiBalaji Chowdary Garapati
Hello John,
   Not sure if i can solve your problem but have a recommendation:
     Based on the code above, looks like the conversion is not in the acceptable format by salesforce api, can you try the following format:  YYYY-MM-DD followed by time?
For more details on  DateTime, have a look at below links:

http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm
and 
http://www.w3.org/TR/NOTE-datetime

 
John VaughanJohn Vaughan
The webservice call failed. The web service returned a SOAP Fault: Code: soapenv:Client Message: 'YYYY-MM-DD 01:22 PM' is not a valid value for the type xsd:dateTime
Balaji Chowdary GarapatiBalaji Chowdary Garapati
Sorry "T" is missing in the format i said, it should be something like this:

1994-11-05T08:15:30-05:00 (YYYY-MM-DDTHH:MM:SS-GMT) or
1994-11-05T08:15:30z which is the zulu converted time.

 
Leelakrishna MunirajLeelakrishna Muniraj
If you are using javascript ajax request from visual force page.This will be solution for insert via Soap API
<apex:page standardcontroller="Account" >
    <apex:includeScript value="/soap/ajax/42.0/connection.js"/> 
      <apex:includeScript value="/soap/ajax/42.0/apex.js"/>       
    <apex:form rendered="{!$ObjectType.Account.fields.Review_Submitted_By__c.Accessible}">
        <button id="btn" style="display:{!IF(Account.To_be_reviewed__c != true, 'block','none')}"  onclick="submitButton()">Submit For Review</button>
       </apex:form>
       <script>
           function submitButton(){
           // Get the namespace 
           var tempName = '{!$CurrentPage.Name}';
           var namespace = tempName.split("__");           
           confirm("are you sure to continue!");
           sforce.connection.sessionId="{!GETSESSIONID()}";  
           var record = new sforce.SObject("Account");
        record.Id = "{!Account.id}";     
        //record.To_be_reviewed__c = true; 
        var dateTime = new Date(new Date().getTime() - new Date().getTimezoneOffset() * 60000).toISOString();
        record.Submitted_ByDateTime__c = dateTime;   // current date and time based on time zone
        record.Review_Submitted_By__c = "{!$User.ID}";
        var result = JSON.stringify(sforce.connection.update([record]));    
        var obj = JSON.parse(result);        
        if(obj[0].success == 'true'){
            //document.getElementById("btn").style.display = "none";        
            alert('successfully updated'); 
            location.reload(true);
        }
        else{
            alert('Error:'+obj);      
            location.reload(true);
        }    
       } 
       </script>
</apex:page>

For your case just concentrate the following line
var dateTime = new Date(new Date().getTime() - new Date().getTimezoneOffset() * 60000).toISOString();