Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Restrict an Enum element to select based on another field value in Line Table. AX 2012 R3

Posted on by Microsoft Employee

Dear Experts,

I have an enum field with 3 elements, eg. InProcess, Delivered and Completed. I want if another field named received is not "1" and user selects completed so it will popup an error msg that "completed cannot be selected because received field is not 1" while leaving the focus from field. Received field is in Line table and enum field in its header table. 

I tried it with enter() but its not working... If someone can share code or way to do that i'll be very thankful.

TIA,

Aamir Raza 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Restrict an Enum element to select based on another field value in Line Table. AX 2012 R3

    Thanks a lot Deepak for your help. You resolved it.

  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    RE: Restrict an Enum element to select based on another field value in Line Table. AX 2012 R3

    I would suggest to write your business logic on modified method of 'EnumField' field. If its a std object, use event handler method of that field.

    if(table.received != 1 && enumfield == Completed)

    error(completed cannot be selected because received field is not 1.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans