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
AmphitriteAmphitrite 

javascript - formatted date-time?

I'd like to update a field to hold the NOW() datetime. What is syntax to do this?

 

{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")} 
var records = {!GETRECORDIDS($ObjectType.Case)}; 
var newRecords = []; 
if (records[0] == null) 

alert("Please select at least one row") 

else 

for (var n in records) { 
var c = new sforce.SObject("Case"); 
c.id = records[n]; 
c.XLS05__c =1; 
newRecords.push(c); 

result = sforce.connection.update(newRecords); 
window.location = '/Apex/CaseCollider'; 
}

Best Answer chosen by Admin (Salesforce Developers)