I am learning ChronoForms V4 and I do have a lot of fun with it and really love it.... but..
I managed to have one form save into two tables, but that is when one field is going into one table.
I cannot find a way to save one field into two different tables...
Is there a way of doing this?
Thanks,
I managed to have one form save into two tables, but that is when one field is going into one table.
I cannot find a way to save one field into two different tables...
Is there a way of doing this?
Thanks,
Hi pieter,
What is saved depends on the input and column names; if they match then the data is saved. If both columns have the same name this should work, if the secodn column has a different name then you need to use a Custom Code snippet to copy the value into a new entry in the $form->data array to match the second column name.
Bob
What is saved depends on the input and column names; if they match then the data is saved. If both columns have the same name this should work, if the secodn column has a different name then you need to use a Custom Code snippet to copy the value into a new entry in the $form->data array to match the second column name.
Bob
Thanks for your early reply. This makes things clear.
So if I have two different column names I can create a custom code like
Do I put this in the events before the DB Save actions?
Thanks!
So if I have two different column names I can create a custom code like
<?php $form->data['user_user'] = $form->data['assign_user'] ; ?>
Do I put this in the events before the DB Save actions?
Thanks!
Hi pieter ,
Yes, exactly like that. Drag a Custom Code action into the event and move it up before the DB Save actions.
Bob
Yes, exactly like that. Drag a Custom Code action into the event and move it up before the DB Save actions.
Bob
Thanks,
I only don't get it to work... is my syntax ok?
Is $form->data['bladibla'] working in this way or can it onlt work when there already is something in the table?
Or is my better option to rename the column?
I only don't get it to work... is my syntax ok?
Is $form->data['bladibla'] working in this way or can it onlt work when there already is something in the table?
Or is my better option to rename the column?
Hi pieter,
It will work provided that there is data in the $form->data array, adding a Debugger action temporarily will tell you what is there.
If it's simple to do and doesn't affect other places the table is used then renaming the column is fine.
Bob
It will work provided that there is data in the $form->data array, adding a Debugger action temporarily will tell you what is there.
If it's simple to do and doesn't affect other places the table is used then renaming the column is fine.
Bob
This topic is locked and no more replies can be posted.