Set default value based on previous entry
3 posts
• Page 1 of 1
Set default value based on previous entryThe user is adding new records, all of which will have the same value for the date field. After the user enters each record, I use code found here to automatically take the user the the data entry screen for another new record. I would like to set the default value of the date field to be equal to the value of the date entered on the previously saved record. How can I do that without duplicating the record and wiping out the other fields (the user may have finished entering records so I don't want to add the next record; I just want to set the date's default value based on the last record entered)?
Re: Set default value based on previous entryWhat strategy are you using for directing the user directly to the new record form after inserting a record? If you are using the after_action_new trigger, then you can just add the date as a parameter to the URL to the new record form, and it will use it as the default value... e.g.
This example assumes that your date field is named 'mydatefield' -Steve
Re: Set default value based on previous entryPerfect! Thanks for your speedy response.
3 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 19 guests |