/// <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
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
You should rather create a new thread and explain your specific problem.
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
Make the post_updateButton method none static and it should work.
Thank Martin.
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.
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."
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.
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156