get foreign key into an add form on a subgrid

Questionsget foreign key into an add form on a subgrid
Doron asked 8 years ago

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

1 Answers
Abu Ghufran answered 8 years ago

Hi,

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.

Your Answer

2 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?