Looking for help to create a computed field that shows 60 days prior to a date field that is manually entered. The manual field's Field ID is BOTTLE_DATE. For example, if BOTTLE_DATE is 9/15/2014, I want the computed field to show 7/17/2014. Thank you!
Solved! Go to Solution.
Solved by gasevsm. Go to Solution.
Solved by gasevsm. Go to Solution.
Thanks, Martin! I get an error when I try that code: "There has been an error in processing your request. Please use your browser's back button and try again or contact your system administrator." I attached the form I used; is your code intended to be entered differently?
Yes not using computed field. Instead..
1. Create an action script with that code in Admin > System Config > Scripting
2. Then go to Admin > Workspace Mgr > [Target Workspace] > Behaviors > Place your new script in onCreate and/or onEdit, depending if want your date calculation to run when items get created, edited or both. If the Behavior section already has scripts set for onCreate or onEdit, you'd have to go back to step 1 and edit those specfic scripts instead of creating a new one, adding the code snippet somewhere in.
3. Create or edit item should now re-calculate date shifts every time.
HTH,
.. and here's how to do it via Computed Field:
BOTTLE_DATE - interval '1 day' * 60
Hi Martin,
Do you think you're able to help with setting up an expiry date similar to this script please?
Rosie.