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)

Disabling display field depending on other field value in a form.

(0) ShareShare
ReportReport
Posted on by

Hi there.

I am kinda new to Dynamics AX, so i would appreciate a little help.

I have table with journals and another table with its lines.

So my problem is that - i have a form with a grid for lines(showings 7-8 fields). One field, let's call it FieldA, is being enabled/disabled(i used active method of lines DS) depending on journal type. And there is another column in grid, that uses display method and returns value depending on FieldA.

So - is it possible to hide this display method column if FieldA has no value in it? I know it would be possible if this column would be a field. Or should i create field, fill it with InitValue and then disable it thru active() method?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Kaspars Jankausks,

    If you will go to a form design and find control (lets say "FormControl1") on a grid that hosts display method, you can set "AutoDeclaration" property to true. After that you can hide it using next code:

    FormControl1.visible(false);

  • Community Member Profile Picture
    on at

    Hi, ievgen Miroshnikov.

    Thank you for replying.

    After setting AutoDeclaration property to true, where should i set visibility to false?

  • Verified answer
    Nishant2408 Profile Picture
    705 on at

    Hi Kaspars Jankausks,

    You can write the logic for hiding the control in datasource active() itself where you are handling enabling\disabling of FieldA.

    Check in if() condition if FieldA is disabled, then make :

    FormControl1.visible(false);

    Regards,

    Nishant

  • Mea_ Profile Picture
    60,284 on at

    You can do it on active method so it will be hidden based on you current line and on modify of FieldA so it would be hidden if user will remove a value from FieldA.

    However, please note that some lines could have value in FieldA and some not so hiding a column does not make a lot of sense.

  • Community Member Profile Picture
    on at

    Thank you both for answers. Modified active() method on DS. Worked just fine. Thanks!

  • Mea_ Profile Picture
    60,284 on at

    Hey Kaspars Jankausks,

    Could you please mark answer(s) that helped you  as verified to close this thread.

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