Automatically Disable a Button

It’s a weird thing that I have a button (let’s name it as Button1) where its AutoDeclaration property is set to YES. This button is place in the first form and is a MenuItem Action button where it calls a class and runs a form - second form. In the first form I have a method that will refresh the entire form see my code below.

void refreshForm()
    common          curRec;
    curRec =;
    //Assume the condition will return true


The method above is called and invoke in the second form’s class.

if (_args.parmEnum() == RunChoose::Run)

When the second form closes, still the Button1 is enabled. Any idean from you guys?

if (formHasMethod(_args.caller(),identifierstr(refreshForm)))

You should also have the enable/disable logic in active method of the form data source.