Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

disable and enable controls depending on selection

Posted on by 2,016

Greetings 

case1.JPG

i'v created a new controls and i want them appear or disappear depending on selection of  Case Category

So that when he chooses an (absence) he shows the absence group and hides the leave group
If he chooses leave, the leave group appears and hides the absence group
If no one chooses, the two groups are hidden

 i crated modified method on (Case Category) controls to check that but that's code not working when start Load form event (i mean when create)

how can i do that?!!

*This post is locked for comments

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: disable and enable controls depending on selection

    Did you debug it? What information did you learn from debugging?

    What if you try to print to infolog the value of the field (the same value that you use in your if statement)? What does it print to infolog?

  • mohammed.mqi Profile Picture
    mohammed.mqi 2,016 on at
    RE: disable and enable controls depending on selection

    thanks for replay

    but on modified when i chose leave

    nothing leave group not shown even when i chose absence

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: disable and enable controls depending on selection

    Could you maybe share any more details about what happens when the modified method is called? Does it go into the if statement?

    Also do you call this same code from the active method of the data source as well? 

  • mohammed.mqi Profile Picture
    mohammed.mqi 2,016 on at
    RE: disable and enable controls depending on selection

    ok you mean i must add the code to active method of the form data source

    sorry but i did this also stil nothing change is there problem in my code!?

    case3.JPG

    case3.JPG

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: disable and enable controls depending on selection

    Modified method is called only when the control is modified.

    In addition to that you need to call your logic from the active method of the form data source. That's called every time the active record changes.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans