web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Checking a check box in a dialog

(0) ShareShare
ReportReport
Posted on by

Good morning,

I'm hitting a little speed bump while making a relatively minor change. In the following code, the check box is added to a dialog. All I'd like to do is have the check box checked on when the dialog displays.

fieldApproveBOM = dialog.addField(enumstr(NoYes),"@LAB01","@HELPLAB");

I've tried ...

fieldApproveBOM.value(NoYes::Yes);

... but that doesn't appear to have done anything. And the fieldApproveBOM doesn't have a checked() method. 

Thank you!

*This post is locked for comments

I have the same question (0)
  • Juan Antonio Tomas Profile Picture
    236 User Group Leader on at
    RE: Checking a check box in a dialog

    Hi,

    You can also try to put all in one code line using addFieldValue method:

    fieldApproveBOM = dialog.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, "@LAB01","@HELPLAB");

    Good luck ;)

  • Verified answer
    Sohaib Cheema Profile Picture
    47,784 User Group Leader on at
    RE: Checking a check box in a dialog

    I have used your code and it worked well, as we can see below

    Dialog dialog;
        DialogField fieldApproveBOM;
        ;
        dialog = new Dialog('TEST');
        
        fieldApproveBOM = dialog.addField(enumstr(NoYes),"@LAB01","@HELPLAB");
        fieldApproveBOM.value(NoYes::Yes);
        
        dialog.run();



    Make sure to set value before dialog runs.

    you may also show us your code, in case if you are unable to resolve

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans