Hello,
I have an AppGini project I am using for record storage. I want the destroy date to calculate automatically by calling the date entered for the box packed date and adding the number of years to retain. I have a date select box for both the packed and destroy date and a drop down list of numbers to select the years to retain the box. I would also like the destroy date to change to permanent if it is selected from the retention drop down instead of a year.
packed date + retention years = destroy date
if permanent selected from drop down list instead of a year, display "permanent" instead of destroy date
Thanks,
Neil
I have added a picture of the add a box page:
Script or filed calculations to add years to a date field
Re: Script or filed calculations to add years to a date field
Hi,
can you post what you have as code so far. Also, are the packed date and destroy date text fields where you enter the date manually? They do not look like datepicker fields. At least the packed date should be a datepicker.
can you post what you have as code so far. Also, are the packed date and destroy date text fields where you enter the date manually? They do not look like datepicker fields. At least the packed date should be a datepicker.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Script or filed calculations to add years to a date field
I changed the packed by field to a date picker. I thought it might be possible to use the calculated field area in appgini. I was just trying to get the date add part working first. The destroy date box could either show "permanent" or be hidden because the retention drop down box would display "permanent" already. I tried adding the following sql query to the "destroy date" field.
SELECT IF(
DATE_ADD(year, 'retention',`packed_date`)As DATE_ADD;
)
SELECT IF(
DATE_ADD(year, 'retention',`packed_date`)As DATE_ADD;
)