Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How Enable or Disable a lookup field Based on enum value on a dialog form !!

(0) ShareShare
ReportReport
Posted on by

I have a Enum Types of Goods with value (Input /Capital Goods) now, I have a lookup field Production order if I chose input Enum value (Input) lookup should be disabled and for Enum value (capital goods) it should be enabled.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: How Enable or Disable a lookup field Based on enum value on a dialog form !!

    Hi Sachin,

    For your scenario - You can add the code on the modified method of the Enum control and based on the current Enum value you can enable disable the other control.

    Similarly you need to add this on active method also.

    Look to the below syntax.

    //check for the enum value
    if(enumvalue = input)
    {
        control.enabled(false);
    }
    else
    {
        control.enabled(true);
    ]

    Thanks,

    Girish S.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: How Enable or Disable a lookup field Based on enum value on a dialog form !!

    First make these controls auto declaration to yes if it's custom form. Then create a new method making the said condition and get the datasource by

    Table table = table_ds.cursor();

    Then simply call this new method in active and modified of that enum.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How Enable or Disable a lookup field Based on enum value on a dialog form !!

    Hi Sachin, You can refer these articles

    theaxapta.blogspot.com/.../how-to-enabledisable-fields-in-dialog.html

    https://wp.me/p1bEiG-go

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans