Mailing List Archive

Update two tables?
I'm able to update fields in one table using for example

[set mv_data_enable]1[/set]
[tag flag write]orderline[/tag]

<FORM METHOD=POST ACTION="[process]">
<INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="orderline">
<INPUT TYPE=HIDDEN NAME="mv_data_key" VALUE="code">
<INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="update">
<INPUT TYPE=HIDDEN NAME="mv_nextpage" VALUE=@@MV_PAGE@@>
<INPUT TYPE=HIDDEN NAME="mv_data_fields" VALUE="code, notes">
...

How would I update two tables at once, say orderline and transactions
where both have a primary key called "code" ?

DB
_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: Update two tables? [ In reply to ]
On 2023-03-05 10:20, DB via interchange-users wrote:

> I'm able to update fields in one table using for example
>
> [set mv_data_enable]1[/set]
> [tag flag write]orderline[/tag]
>
> <FORM METHOD=POST ACTION="[process]">
> <INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="orderline">
> <INPUT TYPE=HIDDEN NAME="mv_data_key"       VALUE="code">
> <INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="update">
> <INPUT TYPE=HIDDEN NAME="mv_nextpage"     VALUE=@@MV_PAGE@@>
> <INPUT TYPE=HIDDEN NAME="mv_data_fields" VALUE="code, notes">
> ...
>
> How would I update two tables at once, say orderline and transactions
> where both have a primary key called "code" ?


You could try an mv_click action:

[set some_action]
[data table="orderline" column="notes" key="[cgi orderline_key]"
value="[cgi orderline_notes]"]
[data table="transactions" column="notes" key="[cgi transactions_key]"
value="[cgi transactions_notes]"]
[/set]


-Andrew

_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users