Master grid (orders) and subgrid (order_items) both have a common field called orderid,
When adding an order item, is there a way to get the foreign key (orderid) into the add form. All answers I have seen seem to be using the previous version of the product
In subgrid of order_item, you can have additional column that will have default value of parent order id.
$o_id = $_REQUEST["rowid"];
if (empty($o_id)) $o_id = 0;
$col = array();
$col["title"] = "Order Id";
$col["name"] = "order_id";
$col["width"] = "10";
$col["editable"] = true;
$col["hidden"] = true;
$col["editoptions"] = array("defaultValue" => $o_id); // set default value
$cols = $col;
You can make it editable and hidden for postback operations.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?