You need to sign in to do that
Don't have an account?
How to Calculate Age in Day?
There is a date field, for inserting date of birth.
There is another button to calculate age (in days) which will be displayed below.
How to do that?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
There is a date field, for inserting date of birth.
There is another button to calculate age (in days) which will be displayed below.
How to do that?
There are multiple posts in Discussion Forums and Success community for the same. Try searching out if this doesn't work.
--
Abhi
If my answer helps to solve the issue/problem/doubt, please mark it as Best Answer; so that people who are stuck in the similar issue get benefitted.
All Answers
{!requireScript("/soap/ajax/26.0/connection.js")}
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd
}
if(mm<10){
mm='0'+mm
}
var today = dd+'/'+mm+'/'+yyyy;
var account = new sforce.SObject("Account");
var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds
var firstDate = today;
var secondDate = selecteddate(YOUR DATE);
var diffDays = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)));
account.id = //set Record Id here, potentially get it from the URL ?id= param
account.field__c = value;
account.dateField=diffDays;
sforce.connection.update([account]);
window.location.reload(); //to reload the window and show the updated values
There are multiple posts in Discussion Forums and Success community for the same. Try searching out if this doesn't work.
--
Abhi
If my answer helps to solve the issue/problem/doubt, please mark it as Best Answer; so that people who are stuck in the similar issue get benefitted.
yes, It is solved.
But further suggestions are welcome.