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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Want to add a check box on a form and when the check box is checked , One field will enable on the form below the check box.

(0) ShareShare
ReportReport
Posted on by 518

Hello all,

Want to add a check box on a form and when the check box is checked , One field will enable on the form below the check box.

Where I can write the code to do so and what line of code I will write to attain my goal.

Thank You

Siddhant

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Crispin John Augustine Profile Picture
    37,081 on at

    are you familiar with the Datasource >> field >> modified() method? You have to write a line of code here. NewField.enabled(Datasource.Field == "your condition");

    Search for examples in another standard form. (Eg: SalesTable)

  • Siddhant Singh Profile Picture
    518 on at

    Hello Crispin,

    Can you please tell me exactly where in the SalesTable form.

  • Siddhant Singh Profile Picture
    518 on at

    Thank you

    CODE for enable and disable field.

    public void modified()

    {

       super();

       if (SST_CustIDDetails.Payed_sst == true )

       {

           SST_CustIDDetails_ds.object(fieldNum(SST_CustIDDetails,CustName)).enabled(True);

       }

       else

       {

           SST_CustIDDetails_ds.object(fieldNum(SST_CustIDDetails,CustName)).enabled(false);

       }

    }

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    The first question is whether the controls (the checkbox and/or the field) are bound to datasource fields or not.

  • Siddhant Singh Profile Picture
    518 on at

    Yes the controls are bounded to data source field.

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Then yes, the code above will work. Just don't forget that you need to call the same thing from active() as well, therefore you should extract it to a separate method. Like this:

    void enableFields()
    {
        SST_CustIDDetails_ds.object(fieldNum(SST_CustIDDetails, CustName)).enabled(SST_CustIDDetails.Payed_sst);
    }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans