I would like to save form data to 2 different database tables, one local and the other remote. It seems that the "DB Save" action only works once per submission, in other words I cannot simply create two separate actions in my form events.
I would like some feedback on how I should go about this.
I thought about a custom action or cURLing the data, but then I thought I should post here first in case it is something as simple as changing a line of code or adding an event loop or something.
I would appreciate any advice or help that can be offered. Thanks.
I would like some feedback on how I should go about this.
I thought about a custom action or cURLing the data, but then I thought I should post here first in case it is something as simple as changing a line of code or adding an event loop or something.
I would appreciate any advice or help that can be offered. Thanks.
Hi groovezog,
You can simply use 2 consecutive "db save" actions, you must use the advanced wizard though!
Regards,
Max
You can simply use 2 consecutive "db save" actions, you must use the advanced wizard though!
Regards,
Max
Hi groovezog,
The DB Save action should work more than once but you will have to take care of the input names to make sure that you are saving the data into the correct table. What makes you think that isn't working?
Bob
The DB Save action should work more than once but you will have to take care of the input names to make sure that you are saving the data into the correct table. What makes you think that isn't working?
Bob
Thanks for the quick responses, guys.
- I've created the two DB Save events. One right after the other.
- I am using the Advanced Wizard.
- Each one of them works separately (when I disable the local one; when I set "Save to Different Database" to "no" on the remote one; OR when I remove one of them).
- When they are both enabled, the form will send the same record twice to the database in the action that is listed first. Nothing is sent to the database in the second action.
I think I have all the settings correct because, like I wrote, each action works when it's by itself. However, if you two both know it works, maybe I am simply overlooking something.
- I've created the two DB Save events. One right after the other.
- I am using the Advanced Wizard.
- Each one of them works separately (when I disable the local one; when I set "Save to Different Database" to "no" on the remote one; OR when I remove one of them).
- When they are both enabled, the form will send the same record twice to the database in the action that is listed first. Nothing is sent to the database in the second action.
I think I have all the settings correct because, like I wrote, each action works when it's by itself. However, if you two both know it works, maybe I am simply overlooking something.
Hi groovezog,
That sounds like there may be a little bug in the DB Save action that doesn't allow the DB object to be redefined for the second save :-(
Bob
That sounds like there may be a little bug in the DB Save action that doesn't allow the DB object to be redefined for the second save :-(
Bob
Do your tables have the same name ?
Could you please try to set different model id for each one ?
If that doesn't work then please try to enable the "save under model id" setting and make sure that your data is posted under that model id to be saved correctly.
Could you please try to set different model id for each one ?
If that doesn't work then please try to enable the "save under model id" setting and make sure that your data is posted under that model id to be saved correctly.
This topic is locked and no more replies can be posted.
