Notifications
Announcements
No record found.
Hi experts,Actually, I wanted to get rid of creating multiple formControl extension classes. For suppose, I have added three buttons on a standard form and I need to write clicked method for each of that button so, for now I am creating multiple formControlStr extension classes. I need to get rid of these classes and need to write clicked method in one extension class. Is it possible?
Note: I do not need it to do in an eventHandler class.
Hi Arif Hussain,
I think this is not possible. Basic syntax of the COC will be decorating the extension class with the name of the element where you are extending. For example if your are writing COC for control 1 you will mention the name of control in the attributes using formControlStr(FormName, Controlname). As you see you need to specifically mention the name of the control then only the system will understand this clicked method will belong to that control.
So you cannot create one extension class for all the controls.
Thanks,
Girish S.
Hi GirishS , Thank you. I really appreciate your response.
Btw, don't you think that we should get all controls and datasources in formExtension as in standard forms we get all things in one class?
Is Microsoft working on this?
Regards,
Arif Hussain
No, which standard class has all the controls and datasource extension in one class?
I don't think this is possible - If you are writing COC for datasource - You can add all the override method and your custom method inside that class particular to that datasource only - Also you cannot add the control level extension codes in the datasource extension class.
Girish S,
Arif, you can log your idea at Dynamics 365 Application Ideas (or vote for it if it's already there).
Hi GirishS , thank you again for your response.
I mean if we create a new form there we can use the datasources and control in one class. So why not in a form extension class?
Below is the image attached for clear understanding.
Oh, currently this is not possible in extension classes where you can club all the methods..
It must be separate class for each elements or controls in the form.
As Martin Drab mentioned you can create an idea in the ideas portal.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 611 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader