You need to sign in to do that
Don't have an account?
TTT
Setting DateTime field via custom button...HELP
We're attempting to utilize a custom button to set the value of a custom date/time field. The custom field (PM_REVIEW_DATE) is defined as DateTime. All the button attempts to do is set the field to Now() and then update the case and reload the window. When we click the button, we get the following error:
A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:Client',faultstring:"9/12/2007 12:15 PM' is not a valid value for the type xsd:dateTime',}
The javascript defined with the button is as follows:
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.PM_Review_Date__c='{!NOW()}';
result = sforce.connection.update([c]);
window.location.reload();
As I understand it, NOW returns a datetime. Why am I getting the above error and how do I correct?
Thanks in advance for the help!
A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:Client',faultstring:"9/12/2007 12:15 PM' is not a valid value for the type xsd:dateTime',}
The javascript defined with the button is as follows:
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.PM_Review_Date__c='{!NOW()}';
result = sforce.connection.update([c]);
window.location.reload();
As I understand it, NOW returns a datetime. Why am I getting the above error and how do I correct?
Thanks in advance for the help!
Message Edited by TTT on 09-12-200710:02 AM
This worked beautifully for me when trying to populate the current date/time into a dateTime field using onClick Javacscript.
-Thanks Steve!
This workd for me!!!