Code not executing in Search App

I have a search App which works fine. It is called from the menu just to assign a global variable from the selection list (drop down list). I need to test against another global variable and no matter where I put the code it does not work. Any clue ?

[glo_customerid]=0;
[glo_customername]='';


$error_test = [glo_companyid] == 0;    // Error test
$error_message = 'ALERT!   Company not selected !'; // Error message

if ($error_test)
{
    sc_alert($error_message);
}

Arthur

Is the Global set as IN / OUT / SESSION?

regards

The globals are set to IN, I display the variables and can see the values in the footer. they are correct.

do you think part of the problem would be the fact that the vars have a blank space in the name?..

Regards

Not sure what “space” you talking about. I see not space anywhere, unless you mean underscore “_” ?

It’s not clear if your code is in the menu app’s onExecute or in the search app itself.

Have you checked from the help that sc_error_message works as per the scope of the app type and ection you’re calling it from? I see for Search apps it only works in “onFilterValidate”.