using header function to open a form in insert mode

prettem

Member
Hi,
Is there a way to invoke this link so that a new record is automatically inserted into the "artikel" table, filled with the default value $id from the hook function?
The idea is to use the save button to create a new record in the subform in one step, without having to go back to the main form and press insert record there.


$hooks['materialentnahme']['insert']['after'] = 'dadabik_materialentnahme_insert';

function dadabik_materialentnahme_insert($id){

$url = "index.php?function=show_insert_form&tablename=artikel&set_field_default_value=1&default_value_field_name=entnahme_id&default_value={$id}";

header("Location: $url");
exit;
}

I tried also this link, but neither of them works for me.
index.php?function=show_insert_form&tablename=artikel&master_table_name=materialentnahme&master_table_function=edit&master_table_where_field=id&master_table_where_value=$id&is_items_table=1&set_field_default_value=1&default_value_field_name=entnahme_id&default_value=$id

thanks for your help
Manuel

Your current DaDaBIK version​

You are using DaDaBIK version 11.10-Elba enterprise, installed on 02.09.2023 (installation code: 1907564f2723317ba7), the latest version of DaDaBIK is 11.12-Elba released on 30.11.2023

You are not running the last release of DaDaBIK, the release you are running might have bugs and security holes, see the official change log for further information. You can upgrade DaDaBIK here.

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.

System info​

PHP Version: 8.1.2-1ubuntu2.14

mysql version: 5.5.5-10.6.12-MariaDB-0ubuntu0.22.04.1

Web server: nginx/1.18.0

Client: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 OPR/95.0.0.0
 
Top