how to use use variable in field name on grid (and form)

Hi There,

I have a menu that uses different vars in the name of the items. i have the following code in onload in the menu

/**

  • Selecting a field from another table
    */

// Check for record
$check_sql = “SELECT conf_event_naam, conf_workshop_naam, conf_ronde_naam, conf_thema_naam, ev_titel, ev_datum_start, ev_datum_eind, ev_subt”
. " FROM event_module"
. " WHERE ev_id = [ev_id]";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]})) // Row found
{
{event} = {rs[0][0]};
{workshop} = {rs[0][1]};
{ronde} = {rs[0][2]};
{thema} = {rs[0][3]};
{titel} = {rs[0][4]};
{start} = {rs[0][5]};
{eind} = {rs[0][6]};
{subtitel} = {rs[0][7]};
}
else // No row found
{
{event} = ‘EVENT’;
{workshop} = ‘WORKSHOP’;
{ronde} = ‘SESSIE’;
{thema} = ‘PROGRAMMA LIJN’;
{titel} = ‘Geen Titel’;
{start} = ‘-’;
{eind} = ‘-’;
{subtitel} = ‘Geen subtitel’;
}

$event = {event};
$workshop = {workshop};
$ronde = {ronde};
$thema = {thema};
$titel = {titel};
$start = {start};
$eind = {eind};
$subtitel = {subtitel};

then i use the vars in the menu and it works.

If i use this code in a grid and place a var in the label name eg. $event the label stays blank.
i tried this on differtent event modes

any suggestion?

You must set globals variables
[event] = {event};
[workshop] = {workshop};
.

And you can use the variables in your apps.

sorry but that did’t do the trick

i changed

[event] = {event};
[workshop] = {workshop};
[ronde] = {ronde};
rtc

and put in the label field [event] etc.

and then i get a message that the globals couldn’t be found

I tested in a form and worked fine.

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-attachmentid”:87992}[/ATTACH]

cap1.JPG

@rotax

in APPLICATION/GLOBAL VARIABLE set the TYPE to OUT and the label stored in the global will show up in your label on he grid.

@nonkelmike @alvagar Yes, it was the combination that did the trick! many thx