Parameters in dynamic Menus

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?

Hello miwalder,
Have you solved this issue?
I also have a dynamic created menu with five steps deep and sc_menu_item macro doesn’t help to get the prodid from that recipe tree.

[TABLE=“border: 1, cellpadding: 1, width: 600”]
[TR]
[TD]$menu = “ordere_interne_treemenu_reteta”;
//-------------------------------------------------------------------------
sc_appmenu_reset($menu);
sc_appmenu_create($menu);
//-------------------------------------------------------------------------

		{codsuperior}=[codsuperior];
		sc_appmenu_add_item($menu,'{codsuperior}',,'[codsuperior]',,,);
		
		$check_sql = "SELECT prodid, consum"
		    . " FROM retete"
		    . " WHERE estenod=1"
		    . " and codsuperior='" .[codsuperior] . "'"
		    . " order by prodid";
		sc_lookup(rs, $check_sql);
		
		foreach ({rs} as $arr_menuitem)
		{
		$item_menu="item.$arr_menuitem[0]";
		    
		sc_appmenu_add_item($menu, $item_menu, '{codsuperior}' , $arr_menuitem[0] . " // " . $arr_menuitem[1], "", "", "", "");
		    
		
		        $check_sql = "SELECT prodid, consum"
		        . " FROM retete"
		        . " WHERE estenod=1"
		        . " and codsuperior='" .$arr_menuitem[0] . "'"
		        . " order by prodid";
		        sc_lookup(rs1, $check_sql);
		
		        foreach ({rs1} as $arr_menuitem1)
		        {
		        $item_menu1="item.$arr_menuitem1[0]";
		    
		        sc_appmenu_add_item($menu, $item_menu1, $item_menu, $arr_menuitem1[0] . " // " . $arr_menuitem1[1], "", "", "", "");
		            
		            
		    
		            $check_sql = "SELECT prodid, consum"
		            . " FROM retete"
		            . " WHERE estenod=1"
		            . " and codsuperior='" .$arr_menuitem1[0] . "'"
		            . " order by prodid";
		            sc_lookup(rs2, $check_sql);
		            
		            foreach ({rs2} as $arr_menuitem2)
		            {
		            $item_menu2="item.$arr_menuitem2[0]";
		
		            sc_appmenu_add_item($menu, $item_menu2, $item_menu1, $arr_menuitem2[0] . " // " . $arr_menuitem2[1], "", "", "", "");
		                
		                
		                $check_sql = "SELECT prodid, consum"
		                . " FROM retete"
		                . " WHERE estenod=1"
		                . " and codsuperior='" .$arr_menuitem2[0] . "'"
		                . " order by prodid";
		                sc_lookup(rs3, $check_sql);
		            
		                foreach ({rs3} as $arr_menuitem3)
		                {
		                $item_menu3="item.$arr_menuitem3[0]";
		
		                sc_appmenu_add_item($menu, $item_menu3, $item_menu2, $arr_menuitem3[0] . " // " . $arr_menuitem3[1], "", "", "", "");
		            
		                    
		                    $check_sql = "SELECT prodid, consum"
		                    . " FROM retete"
		                    . " WHERE estenod=1"
		                    . " and codsuperior='" .$arr_menuitem3[0] . "'"
		                    . " order by prodid";
		                    sc_lookup(rs4, $check_sql);
		            
		                    foreach ({rs4} as $arr_menuitem4)
		                    {
		                    $item_menu4="item.$arr_menuitem4[0]";
		
		                    sc_appmenu_add_item($menu, $item_menu4, $item_menu3, $arr_menuitem4[0] . " // " . $arr_menuitem4[1], "", "", "", "");
		            
		                        
		                        $check_sql = "SELECT prodid, consum"
		                        . " FROM retete"
		                        . " WHERE estenod=1"
		                        . " and codsuperior='" .$arr_menuitem4[0] . "'"
		                        . " order by prodid";
		                        sc_lookup(rs5, $check_sql);
		            
		                        foreach ({rs5} as $arr_menuitem5)
		                        {
		                        $item_menu5="item.$arr_menuitem5[0]";
		
		                        sc_appmenu_add_item($menu, $item_menu5, $item_menu4, $arr_menuitem5[0] . " // " . $arr_menuitem5[1], "", "", "", "");
		            
		                        }
		                        
		                    }
		                    
		                }
		            }
		    
		        }    
		}
		
		 [/TD]
	[/TR]
 [/TABLE]