Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Sample events > Appearance

PHPrunner32x32     PHPRunner manual


Redirect to the details page after adding the master record

Scroll Prev Next More

 

Sometimes you need to redirect visitors to the details table (e.g., Order details) right after a new master record was added (Orders table).

 

The trick is to pass correct key field to the details table. Once user redirected there she can start adding details records using Inline or regular Add.

 

The following code needs to be added to AfterAdd event of the master table.

 

Note: Change red values to match your project.

 

header("Location: order_details_list.php?mastertable=orders&masterkey1=".$values["OrderID"]);
exit();

 

In this example:

 

order_details_list.php

the URL of the details List page;

orders

the master table name;

OrderID

the name of the key field.

See also:

Master-details relationship

Key columns

Event editor

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software