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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

formHasMethod not checking for form extension methods

(0) ShareShare
ReportReport
Posted on by 10

Hi !

I have the following form extension class:

[ExtensionOf(formStr(EcoResProductDetailsExtended))]
public final class EcoResProductDetailsExtended_Extension
{
    public Set myMethod()
    {
        Set mySet;
return mySet; } }

Then I want to evaluate if that method exists before call it:

 if (formHasMethod(_formRun, 'myMethod'))
 {
 	localSet= _formRun.myMethod();
 }


The formHasMethod return false. It isn't being able to evaluate the extension method. If I call myMethod() without checking for it before hand, it is executed correctly.

I'm trying to use MetadataSupport helper class but I'm not succeeding.

Does anyone have some clue about it?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: formHasMethod not checking for form extension methods

    As Martin pointed, this does work in 8.0!

  • Martin Dráb Profile Picture
    235,804 Most Valuable Professional on at
    RE: formHasMethod not checking for form extension methods

    I was told that formHasMethod() has got this capability in PU18.

  • István Orosz Profile Picture
    2,137 on at
    RE: formHasMethod not checking for form extension methods

    It is generally the same solution as was suggested on 15 Nov 2017 by Axaptus.

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at
    RE: formHasMethod not checking for form extension methods

    Please have look this blog, maybe you will get the resolution from here...

    Please mark as Verified if shared blog helpful to you.

    http://d365technext.blogspot.com/2018/08/formhasmethod-extension-in-d365fo.html

  • Axaptus Profile Picture
    10 on at
    RE: formHasMethod not checking for form extension methods

    I've found a posible solution and I posted it here:

    community.dynamics.com/.../256465

  • Axaptus Profile Picture
    10 on at
    RE: formHasMethod not checking for form extension methods

    I'm using Platform update 5.

  • Axaptus Profile Picture
    10 on at
    RE: formHasMethod not checking for form extension methods

    Thanks Zain for your prompt answer.

    Yes, I've verified calling formHasMethod method for a standard form method and it worked well.

    The method is called from an event handler class wich is in the same model where the Extension class.

    I'm looking for some metadata helper yet. Any clue will be appreciated.

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: formHasMethod not checking for form extension methods

    Have you tried to check this condition for a default method name from original form? Does the condition work then?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans