Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

setting control mandatory

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

i'm having a issue i have set the control mandatory on through active() but the problem is when open the form it does not show me red line that shows it is set as mandatory but when i click on control then it show me the red line in the control......

anyone please suggest me what should i do to set control mandatory when i open the form

*This post is locked for comments

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: setting control mandatory

    Hi,

    Please try with the following statement and when you say on opening the form, does the control/field have data in it. If so, it's the expected behavior.

    DatasourceName_ds.object(fieldNum(TableName, inventSiteId)).mandatory(true);
    DatasourceName_ds.object(fieldNum(TableName, ItemId)).mandatory(true);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: setting control mandatory

    public int active()

    {

    if(table.formulaId == "1")

    {

     formulasheet1.enables(true);

     formulasheet2.enables(false);

     formulasheet3.enables(false);

     itemId.mandatory(true);

     inventSiteId.mandatory(true);

    }

    and so on for different formulaId

    }

    suggest me what should i do

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: setting control mandatory

    i'm on different client i'll share my code later if you don't mind....excuse for my delay

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: setting control mandatory

    thanks for reply sukrut...

    controls are in condition that is why is have used active method, and i have to set controls mandatory not line, i said that on setting control mandatory a red line appears but it does'nt the red line appears when i click the controls

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans