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)

Disabled field in one record in the table

(0) ShareShare
ReportReport
Posted on by

Hello!

I want to disable field in the table, if field YesNo in the same table is No. Any ideas?

Thanks ;)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You can do it on form, by overriding 'Active()' method of the modify datasource table on the form

    let suppose datasource table name is TableA

    so write following code in Active() method

    if(TableA.YesNO == 'No')

     TableA.AllowEdit(false)

    else

     TableA.AllowEdit(true)

    Please verify and let me know if it works for you.

  • Community Member Profile Picture
    on at

    it doesn't work. I need some, like TableA.fieldToDisable.   << and after dot disable that field. Or smth like this

  • Community Member Profile Picture
    on at

    are you looking to disable only the field?

  • Community Member Profile Picture
    on at

    Yes, only one field in the record where other field NoYes will be no

  • Suggested answer
    Community Member Profile Picture
    on at

    Go to the design of the form and location the text box related to the field

    Set the Auto declaration property of the text box as true

    let suppose text box name is TextBoxA

    so write following code in Active() method

    if(TableA.YesNO == 'No')

    TextBoxA.enabled(false)

    else

    TextBoxA.enabled(true)

    Please verify if this solves your problem

  • Suggested answer
    Dennis Huesmann Profile Picture
    on at

    Try following code:

    YourTable_ds.object(fieldNum(YourTable, YourField)).enabled(YourValueToCheck);

    This way you do not need the AutoDeclaration flag and all occurences of the field linked to the data source are disabled/enabled depending on your condition.

  • Community Member Profile Picture
    on at

    NITESH RANJAN,  DENNIS HUESMANN thanks for your answers, but that problem is not solved :(

  • Dennis Huesmann Profile Picture
    on at

    Could you post your actual lines of code, please (or at least table and field names). Maybe that would clarify things ;)

  • Suggested answer
    Community Member Profile Picture
    on at

    Please Keep one thing in mind this solution will be application on the form only, you cant have in on the table browser

    Please verify.

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