Skip to main content

Notifications

Dynamics 365 Community / Blogs / Dynamics AX training / How to make dialog fields m...

How to make dialog fields mandatory

See example below on how implement mandatory fields in dialog:

    boolean             ret;
    FilePath            workFolder;

    Dialog              dlg;
    DialogField         dfWorkFolder;
    FormStringControl   fsc;
    FormGroupControl    fgc;
    ;

    dlg             = new Dialog( "@CDT135" );
    dfWorkFolder    = dlg.addField( typeid( FilePath ), "@CDT136" );
    fgc             = dlg.mainFormGroup();
    fsc             = fgc.controlNum( 1 ); fsc.mandatory( true );

    while( dlg.run() )
    {
        workFolder  = dfWorkFolder.value();

        if( workFolder)
        {
            ret     = true;
            break;
        }

        dlg.doInit();
    }

This was originally posted here.

Comments

*This post is locked for comments