Skip to main content

Notifications

Microsoft Dynamics AX forum
Suggested answer

setting control mandatory

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

  • 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans