May 13th, 2009, 7:55 PM
Hey Brian,
Neat problem! Yes, the pre-parser is certainly the module for it, but it will require a little fiddling to get it going.
Normally, form submissions are added either via the process.php file or the API, but in your case neither really fit the job. You'll want to add some code to the pre-parser rule that inserts the record into the second table; once that's done the original form submission is added normally. Bingo! Two form submissions added in two different tables.
Speaking in general terms I'd suggest looking into the ft_create_blank_submission() function, which returns a new submission ID. You can then compile a hash of form information and pass it all along to the ft_update_submission() function.
If you get stuck, post me back - I know the above comments are very general, so I don't mind looking into it directly if you like. That said, I probably won't have time until the weekend.
Anyway, hope all is well!
- Ben
Neat problem! Yes, the pre-parser is certainly the module for it, but it will require a little fiddling to get it going.
Normally, form submissions are added either via the process.php file or the API, but in your case neither really fit the job. You'll want to add some code to the pre-parser rule that inserts the record into the second table; once that's done the original form submission is added normally. Bingo! Two form submissions added in two different tables.
Speaking in general terms I'd suggest looking into the ft_create_blank_submission() function, which returns a new submission ID. You can then compile a hash of form information and pass it all along to the ft_update_submission() function.
If you get stuck, post me back - I know the above comments are very general, so I don't mind looking into it directly if you like. That said, I probably won't have time until the weekend.
Anyway, hope all is well!
- Ben