You need to sign in to do that
Don't have an account?
Amphitrite
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';
}
Hello,
NOW() doesn't work with Javascript. Please refer following link addressing similar issue:
http://stackoverflow.com/questions/10211145/getting-current-date-and-time-in-javascript
http://stackoverflow.com/questions/15064590/epoch-time-using-salesforce-apex-code
http://stackoverflow.com/questions/14347890/how-to-parse-time-in-salesforce-visualforce-apex