web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Validate a display men...
Finance forum
Unanswered

Validate a display menu item

(1) ShareShare
ReportReport
Posted on by 252
Hi,
 
I have a display menu item that is linked to a dialog form. And this menu item is added to a standard form.
 
So on the standard form, when i click this menu item, i want a validation to be run before the dialog actually opens. If the validation passes the dialog opens, if not then dialog doesn't open and a warning is shown.
 
Where to put the code exactly for the validation using CoC?
  • Waed Ayyad Profile Picture
    9,228 Super User 2026 Season 2 on at
    Hi,
     
    You can add your code to on clicked event handler of the menu item before next() or you can add your code to the init method of Dialog form.
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     
  • Ariba Mehdi Profile Picture
    166 on at
    Hi,

    You can make the CoC for formControl and override the clicked() method of the button. 
     
    [ExtensionOf(formControlStr(formName,controlName))]
    final class className_Extension
    {

        public void clicked()
        {
            next clicked();
           //validation
           if(true)
           {
                   // call the dialog here
           }
           else
                   //warning
        }
    }
     
    Hope it helps!

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans