Procedure for MRT
Nick, there is quite a few steps in setting up the MRT, but get the hang of it and it will open many doors for you.
Here is the procedure I copied from the archives pasted below.
If you go through this slowly and thoroughly you'll get it working.
It is a sensational plugin.
Take note of removing the original redirect url that the wizard puts in, then on step 1 of MRT place it back in there. MRT action occurs after the code above it has created the PK ID number, this is then place in the lookup table as MRT does its stuff.
Remember that MRT will insert (if your on the insert page) or update(if your on the update page) any data you want to throw into a lookup table.
If your on the insert page you would use $_SESSION['WADA_Insert_tblVendors'] as the binding data PK in MRT, then on the update you would use the record set.
Regards Russ
Here is the basic idea of how to use this server behavior.
1
Start on an insert or update page. You will first need to add a new recordset to your page to select the records from your secondary table, for example if you were configuring product options you would have a recoredset select all the records from your options table that you would like to associate with this product.
Remove link in $WA_redirectURL = "";
2
Once the recordset is in place on the page you will need to add the input to record the values of this secondary table. In regards to the example above you can add in a checkbox.
3
Next you will need to associate this new input with your new recordset. For the value you can bind the id from the new recordset, and for the label you can just use whatever value from the recodset would best reflect that record.
4
The next thing to go is to apply the repeat region server behavior to this new input and the label for it. In the repeat region server behavior make sure to choose your new recorset and let it display all records.
5
The final part is to add in the Manager Relational Table server behavior. When you add this server behavior you will fist need to specify the trigger and the relational table. For the trigger you can just use the button insert/update pressed. For the table make sure to select your relational table. Make sure you select the redirect page on this step.
On the next step you will select which column in your relational table will hold the id from your main table, you also need to select what type of data this will be and use the lightning bolt icon to select the id value that will be inserted here, it should be the id for the just inserted record held in the session varialble for an insert page and the id from the product recordset for an update page.
In the step after this you will select the column in the relational table that will hold the secondary table's id, like the previous step you will need to select the data type, for the value it should be defaulted to your repeat region input.
In step 4 of 4 you can set the value of the id or other columns in this table, if you have an auto incrementing id then you do not need to set a value for this column. You can finish it now to add the Manage Relational Table server behavior into your page.
When you test the page out you should see your newly added repeat region with the values from the recordset displayed. When you select these values and insert or update it should update your relational table.