Trying to add parms to sc_appmenu_add_item

I am trying to pass a parm when I create my dynamic menu from my database.

I am trying to add
personid = 307
to one of the menus so when it’s clicked on, it will open the form for the prson table, but only show me where personid = 307

This works great if I create the the menu item like this:

sc_appmenu_add_item(menu,$arr_item[1],$arr_item[4], $arr_item[0], $arr_item[2], personid = 307, ,$arr_item[3] , );

where I have loaded an array with my other values, but I am not able to do something like this:

sc_appmenu_add_item(menu,$arr_item[1],$arr_item[4], $arr_item[0], $arr_item[2],$arr_item[5] , ,$arr_item[3] , );

where $arr_item[5] is a string that contains the words
personid = 307

Does anyone know how I can get this to work?

Re: Trying to add parms to sc_appmenu_add_item

Are you getting an error message?

I have to ask the obvious … no quotes? or is that just for the post?
Does thing function not require quotes for the string? I see the help files does not show, but that means nothing <g>

does this work:

$mystring = ‘personid = 307’;
sc_appmenu_add_item(menu,$arr_item[1],$arr_item[4], $arr_item[0], $arr_item[2],$mystring , ,$arr_item[3] , );

Scott.

Re: Trying to add parms to sc_appmenu_add_item

Or something like:

$mystring = ’ " ‘.$arr_item[5].’ " ’

Scott.

Re: Trying to add parms to sc_appmenu_add_item

It doesn’t require the quotes.

I tried:
$mystring = ‘personid = 307’;
sc_appmenu_add_item(menu,$arr_item[1],$arr_item[4], $arr_item[0], $arr_item[2],$mystring , ,$arr_item[3] , );

but it doesn’t work.

In looking at the code that gets generated it looks like it parses out the string and creates some strange stuff from it, so if it has $mystring in it, it doesn’t actually use the value that’s in the string, it tries to parse the actual $mystring out…

I ended up doing this which appears to work, though is a little strange.

If the parm that I want is the personid one, I just change my actual add_item line to
sc_appmenu_add_item(menu,$arr_item[1],$arr_item[4], $arr_item[0], $arr_item[2],personid = $_SESSION[‘g_id_user’], ,$arr_item[3] , );

It’s like it’s parsing it out at generate time, and not at run time.

But I think I’ve got it working at this point.

Re: Trying to add parms to sc_appmenu_add_item

use double quotes instead of single quotes