Forum Discussion
_anomDiebolt_
10 years agoQrew Elite
Historically there have been two methods for creating a new record and immediately performing some additional action such as automatically creating related child records. These two techniques have not been publicly published because they might require lengthy support from the author (me). Now I have created a new technique which I call the Save and Scooby Doo technique which I am publishing because I think it will not require any special support. Here goes:
Save and Scooby Doo ~ Add New Record
https://haversineconsulting.quickbase.com/db/bkjdxnw2x?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=465
I must say this is my best technique in all of 2016.
UPDATED:
Notes:
Save and Scooby Doo ~ Add New Record
https://haversineconsulting.quickbase.com/db/bkjdxnw2x?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=465
I must say this is my best technique in all of 2016.
UPDATED:
Notes:
- The script adds a hidden <iframe> to the new record page. The <iframe> is initially empty of content but it will be used to receive the response of submitting the New Record form. This may appear odd that you can target when the response of a form submission can go because the normal behavior is to reload the page with the form submission's response. However, just as you can retarget where the response to clicking on a hyperlink can go (a <a> element), you can retarget where an <form>'s response go appear.
- The script modifies the standard New Record Form (name=editform) by adding a target to the <form> pointing to the <iframe>. The net result of these two changes is that when the <form> is submitted the response will be written to the hidden <iframe> the host page will not reload as it normally would.
- When the <iframe> is finished loading the URL is extracted and the [Record ID#] of the newly created record being now displayed in the hidden <iframe> is parsed out can converted to a decimal value.
- We now know the [Record ID#] of the newly created record and we throw up a jQuery UI modal dialog displaying the [Record ID#] value along with an image of Scobby Doo.
- This technique is very general and can be used for a range of tasks where you want to do something further with a newly created record. Typical tasks might be to automatically create various child records or to edit the newly created record with perhaps a different form.