I am updating the record in the javascript while clicking on custom button. I have custom date/time field Approved_Date__c. I need to update that fields also using javascript. How can I assign current date/time to Approved_Date__c field?
I tried like
set("Approved_Date__c",NOW());
set("Approved_Date__c",Date.NOW());
set("Approved_Date__c",Date.Time());
but i am getting:
A problem with onclick javascript for this button or link was encountered. Now not defined.
I tried like this also
jpt.Approved_Date__c=new Date().toLocaleString();
it's showing as:
{faultcode:'soapenvClient', faultstring:''3/21/2016, 3:05:33 PM' is notavalid value for the type xsd:dateTime',}
apex:inputhidden
and set the value of that inputhidden