• Code monkey see code monkey do
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

Hi guys,

 

I have a very strange problem with a custom DateTime field. When I write any date+time value, the date will write correctly but the time portion will always be written at 01:00:00 For example the java Date object contains 2013-09-24T15:53:27.000Z (as confirmed by a trace output statement) then when the field is written to Salesforce it will display as "24/09/2013 01:00". Fields are being written in the usual way:

 

javaDate=new Date();

SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
String strFormattedDate = sdf.format(javaDate);

System.out.println("javaDate="+strFormattedDate);

 

SObject[] records=new SObject[0];

records[0].setType("CustomTable__c");

records[0].setField("DateCreated__c", javaDate);

saveResults = conn.create(records);

 

Any idea why this is happening? Is it something about my custom Date/Time field "DateCreated__c" ???

 

Thanks,

Mark.

Hi guys,

 

I'm fairly new to Salesforce and trying to do something pretty simple - update a field in a table which we have created using the Java SOAP API. Using SQL this would be something like:

 

UPDATE Custom_Employees__c

SET Leaving_Date__c='2013-09-04T17:50:45.000Z'

WHERE Employee_Number='0123456789'

 

Despite reading the SOAP API documentation and LOTS of googling I still cannot find any example code (and it looks like SOQL has no Update statement ???)

 

Can somebody please post a link or some example code?

 

Thanks in advance,

Marcus.

Hi guys,

 

I have a very strange problem with a custom DateTime field. When I write any date+time value, the date will write correctly but the time portion will always be written at 01:00:00 For example the java Date object contains 2013-09-24T15:53:27.000Z (as confirmed by a trace output statement) then when the field is written to Salesforce it will display as "24/09/2013 01:00". Fields are being written in the usual way:

 

javaDate=new Date();

SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
String strFormattedDate = sdf.format(javaDate);

System.out.println("javaDate="+strFormattedDate);

 

SObject[] records=new SObject[0];

records[0].setType("CustomTable__c");

records[0].setField("DateCreated__c", javaDate);

saveResults = conn.create(records);

 

Any idea why this is happening? Is it something about my custom Date/Time field "DateCreated__c" ???

 

Thanks,

Mark.

Hi guys,

 

I'm fairly new to Salesforce and trying to do something pretty simple - update a field in a table which we have created using the Java SOAP API. Using SQL this would be something like:

 

UPDATE Custom_Employees__c

SET Leaving_Date__c='2013-09-04T17:50:45.000Z'

WHERE Employee_Number='0123456789'

 

Despite reading the SOAP API documentation and LOTS of googling I still cannot find any example code (and it looks like SOQL has no Update statement ???)

 

Can somebody please post a link or some example code?

 

Thanks in advance,

Marcus.