Default date set 1 year from CurrDate()

Hi,

I have a entity attribute of DateCreated with the data type of Date. However, in my database, i want to set the default value as one year from CurrDate(). How do i express this correctly in the "Default value" input? 

Solution

Hi, friend.

Normally you could use the function AddYears(CurrDate(),1) but it does not working as Default Value to attributes.

If you need to save this attribiute as one year from current date, just pass the function AddYears(CurrDate(),1) in your save methods, because I don't a way to set this value there as you want.


Solution

Jolene Kwek wrote:

Hi,

I have a entity attribute of DateCreated with the data type of Date. However, in my database, i want to set the default value as one year from CurrDate(). How do i express this correctly in the "Default value" input? 

Hi Jolene


you dont want to pass createddate from frontend??

OR

If you have to pass createddate then you can do by AddYears(currdate(),1)


Hi Lenon and Salman

i think i will just use AddYears(CurrDate(),1), in the forms instead. Thank you for helping!


Jolene Kwek wrote:

Hi Lenon and Salman

i think i will just use AddYears(CurrDate(),1), in the forms instead. Thank you for helping!


Yes that why platform provide us the AddYears function.


I'm glad to help!


Best regards