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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Error-The constructor for class 'EcoResReleasedProductV2EntityToCrssTableDataAdaptor' is not visible in this context due to the protection level of the class.

(0) ShareShare
ReportReport
Posted on by 6

  private EcoResReleasedProductV2EntityToCrossTableDataAdaptor crossTableDataAdaptor()
    {
        return EcoResReleasedProductV2EntityToCrossTableDataAdaptor::newFromEntity(this);
    }

here newfromentity method is being called from an AOT class  and have two methods with parameter EcoResEntity but i wanted here my parameter i.e OABEcoresEntity but this error is coming , i have duplicate this class and added my parameter

  public static EcoResReleasedProductV2EntityToCrossTableDataAdaptor construct()
    {
        return new EcoResReleasedProductV2EntityToCrossTableDataAdaptor();
    }

    public static EcoResReleasedProductV2EntityToCrossTableDataAdaptor newFromEntity(EcoResReleasedProductV2Entity _releasedProductEntity)
    {
        var adaptor = new EcoResReleasedProductV2EntityToCrossTableDataAdaptor();
        adaptor.initFromEntity(_releasedProductEntity);
        return adaptor;
    }

  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at

    Hi sachin mittal,

    After duplicating the class you need to replace the standard class name with your custom class name.

    Seems in the code you are using standard class in construct method and also in newFromEntity method.

    Thanks,

    Girish S.

  • Verified answer
    Martin Dráb Profile Picture
    241,635 Most Valuable Professional on at

    You can't call the constructor of EcoResReleasedProductV2EntityToCrossTableDataAdaptor class (new EcoResReleasedProductV2EntityToCrossTableDataAdaptor()), because it's protected and therefore it can be called only from EcoResReleasedProductV2EntityToCrossTableDataAdaptor class itself or its children.

    If you open EcoResReleasedProductV2EntityToCrossTableDataAdaptor class, you'll notice that new() is protected, but there is a public factory method called construct(). That's the usual pattern in AX/F&O.

    Therefore you should replace new EcoResReleasedProductV2EntityToCrossTableDataAdaptor() with EcoResReleasedProductV2EntityToCrossTableDataAdaptor::construct().

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 274 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 219

#3
Subra Profile Picture

Subra 202 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans