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.
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.
Thanks,
Girish S.
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.
Arif, you can log your idea at Dynamics 365 Application Ideas (or vote for it if it's already there).
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.
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
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.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156