I programed a dynamic menu with products and I want to send the ID as a parameter to open a form with this record.
In the onLoad action of the menu y programed the following code:
$sqlproducts = "SELECT ID, artname FROM products ORDER BY artname";
$sqlzones = "SELECT ID, zone FROM zone ORDER BY zone";
$i = 0;
sc_reset_global([productid]);
sc_appmenu_create("menu_1");
sc_appmenu_add_item('menu_1','clients','','Clientes','grid_products',,,,);
sc_lookup(ds, $sqlzones);
foreach ({ds} as $line) {
$i++;
$zoneid = $line[0];
$zone = $line[1];
sc_appmenu_add_item('menu_1','item_'.$i,'clients', $zone,'form_categoria','var_zone='.$zoneid,,,);
}
sc_appmenu_add_item('menu_1','products','','Productos','grid_products',,,,);
sc_lookup(ds, $sqlproducts);
foreach ({ds} as $line) {
$i++;
$productid = $line[0];
[var_productid] = {productid};
$artname = $line[1];
sc_appmenu_add_item('menu_1','item_'.$i,'products', $productid.$artname,'blank?productid={productid}','productid={productid}',,,,);
}
sc_appmenu_add_item('menu_1','admin','','Admin','',,,,);
Following the manual the creating of menu items works as following:
sc_appmenu_add_item (“Menu_Nome”, “Id_Item”, “Id_Pai”, “Label”, “Application”, “Parameter”, “Icon”, “Hint”, “Target”)
But I can fill in whatever in the “Parameter” field I can’t access it. In a blank application I tried several ways like this:
echo $productid;
echo $_SESSION["productid"];
echo $_GET["productid"];
echo $_POST["productid"];
echo [var_productid];
echo {productid};
But I get only error messages. It is a very basic thing in PHP to send variables from one page to another with URL parameters but I can’t figure out how this works in scriptcase. Any ideas?