Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Mandatory property set as yes not working for a form control which is not linked to data source

Posted on by 97

i have a date field in my form  which is set as mandatory using property but only red line appears when i click any othedr place it does not show any error or warning message

*This post is locked for comments

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    Finally resolved it was not due to custom code. I closed ax and then reopened it . it worked

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    You still have your custom code somewhere, just search it and remove it.

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    i removed code from validatewrite and only wrote the code in clicked method. I dont know why it is showing 2 errors

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    Yes. But shouldn't the second one go away if you remove your code from validateWrite, and instead only call your own validation when the button is clicked.

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    that is only the issue, when i enter some data in field and then clear it out . after that when i click on find  it displays 2 error messages

    1. the system's message [becoz the field is set mandatory]

    2. the message i printed via code

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    Just set property Mandatory to true.

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    But what if i want the mandatory red line in that particular control??

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    Just remove all your old validations regarding this field and put your validation only in the button click.

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    getting another issue as the field is mandatory and if i fill the field with some value and then clear it and then click on find it displays 2 error messages

    1. the system's message

    2. the message i printed via code

  • Palak jain Profile Picture
    Palak jain 97 on at
    RE: Mandatory property set as yes not working for a form control which is not linked to data source

    thanks it worked

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans