/// <summary>/// PostHandlerFor method of updateButton/// </summary>/// <param name="args"></param>[PostHandlerFor(formStr(ProjStatistic), formMethodStr(ProjStatistic, updateButton))]public static void ProjStatistic_Post_updateButton(XppPrePostArgs args){
// element.MySpecificExtensionMethod // How use an form extension method from the extension form?
}
*This post is locked for comments
To seemingly add new methods, use class extensions. Yes, it works with forms as well, you'll just use [ExtensionOf(formStr(ProjStatistic))]. You can see an example in Code behind extension forms: How to add state variables and override methods without overlayering.
Thank Martin.
I could not use variables in form extension:
[ExtensionOf( formstr( ProjStatistic )) ]
final class ProjStatistic_Extension
{
public real xxxCalc;
public static void xxxlCalc)
xxxCalc = 10;
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(formStr(ProjStatistic), formMethodStr(ProjStatistic, updateButton))]
public static void ProjStatistic_Post_updateButton(XppPrePostArgs args)
I think my AX version (Platform1) did not support variables in form extension:
"Fields on an extension class is only supported if the ExtensionOf attribute is used on a class."
It's possible; I don't gave the one-year-old version to test it.
Note that the support for Platform Update 1 ends in less than three weeks, so you should upgrade very soon anyway.
Make the post_updateButton method none static and it should work.
Hi Foxsor, Can you resolve the problem? I have a similar problem, but I can not solve it, in case you could share your solution, I would appreciate it, Regards
You should rather create a new thread and explain your specific problem.
Hi Martin,
I have added a new method in the form using class extension. In the place where i am calling it, I would like to have a check if the formHasMethod and call the method using formRun object. Is it possible? When I try this, it says method does not exist on the form, actually it is existed on the underlying class extension. Can you please help me out how to solve this scenario?
Regards,
Giridhar
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 Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Tocauer 4
Alexey Lekanov 3
Willem van Duren 2