Use global variable

Hello,

i’ve set a global variable with

$usr_group = {rs[0][3]}; ( some field in a table )

and

sc_set_global($usr_group);

How can i use this in another application like

if ({Responsibility} == ‘$usr_group’) // Set as read-only
{
sc_field_readonly({progress}, ‘off’);
}
else // Set as editable
{
sc_field_readonly({progress}, ‘on’);
}

Please respond , thanks in advance

Erwin

if ({Responsibility} == [usr_group])

Thanks, i’ve tried it but does not work. It is used in a forms application with the multiple records configuration.
Is there a way to show a messagbox with the valu of the global variabele ? To check it is filled?

1 Like

Thank you, i had to add the Redir macro and confirmed the value is available! So far so good. But the sc_field_readonly is still not working.

Even without a varaiable and with a string it does not work!

Any other suggestions?

if ({Responsibility} == [usr_group]) // Set as read-only
{
sc_field_readonly({progress}, 'on');
}
else // Set as editable
{
sc_field_readonly({progress}, 'off');
}

You reversed on and off

App/Golbal variables/ in out/ out