Using application script, add days to a date that was set in a form
Users set "First Day" creating a new record.
I have it in my script: def fday = currentValues["First Day"]
Than I want to add for example 30 days and save this new date in a date field. (using script)
Thanks a lot
To add 30 days to your date with application scripts, you first need to create a variable with the original date, like this:
Date newDate = currentValues["First Day"] as Date
Next, you can update the variable by adding 30. If you add an integer to a date, application scripts will always treat that integer as a number of days (as opposed to hours, months, etc).:
newDate = newDate + 30
Finally, save the updated variable into the new date field.:
currentValues["New Date"] = newDate as Date
I hope this is helpful. If you have any additional questions on this, feel free to contact our support team directly at email@example.com.