You need to sign in to do that
Don't have an account?
Gerry Gregoire
How can i take date value and insert into another date field?
Hi there,
I basically want to take the value of one date field and send that value to another date field.
The second date field should still be able to be customised though.
Any help would be much appreciated.
regards
Gerry
I basically want to take the value of one date field and send that value to another date field.
The second date field should still be able to be customised though.
Any help would be much appreciated.
regards
Gerry
You can take the date value by using Date.newInstance(year,month,day)
and you can assign it to any other date field or modify it using date class methods
public class checkDate{
public static void asignDate(Date mydate){
DateoldDate = mydate.addDays(30);
Date newDate = oldDate;
system.debug(newDate);
}
}
if we pass these values in the Execute anonymous code
Date varDate = Date.newInstance(2015,10,9);
chkDate.equalDate(varDate);
the output will be:2015-11-08 00:00:00
Many thanks - where do i insert this code? Within the new date field?
Gerry
public class checkDate{
public static void asignDate(Date mydate){
DateoldDate = mydate.addDays(30);
Date newDate = oldDate;
system.debug(newDate);
}
}
Execute these below statements in the Execute anonymous Window
Date varDate = Date.newInstance(2015,10,9);
chkDate.equalDate(varDate);