Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

setFocus() method doesnt work in sysOperationFramework

Posted on by 157

Hello to everyone.

I want to use setFocus() method for a control of a sysOperationFramework form to move the cursor directly to a specific control.

I use the UIBuilder class for that and more specifically the postRun() method. 

everything I am trying to use like enable(), visible(), etc works fine. 

But setFocus() method doesn't seem to work for some reason. I also tried to do it in postBuild() but I had an error in stack trace that said that setFocus() does not exist. 

The block below describes the code I use.

public void postRun()
{
    FormReferenceControl plainText;

    super();

    plainText = this.bindInfo().getDialogField(contract,
        methodStr(MyContract, parmPlainText)).control();

    plainText.setFocus();
    
}

Does anyone know what could be the reason that this method does not work?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans