Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Extension object does ...
Finance forum

Extension object does not have method

(0) ShareShare
ReportReport
Posted on by 583

Hi all,

I create an extension of SalesTable form and add a display methode stored in SalesLine table on the form extension. The SalesTable form have had extension in several modules. The SalesLine table also have had extension, but no extension that stored in a class (only metadata extension like new field).

the display methode is coded as follows:

[SysClientCacheDataMethodAttribute(true)]

public display ImageRes drawingDifference(SalesLine _salesLine)

{

    #resAppl

    PurchLine icLine;

    SalesTable salesTable = _salesLine.salesTable();

    if (salesTable.InterCompanyCompanyId)

    {

        changecompany(salesTable.InterCompanyCompanyId)

        {

            icLine = PurchLine::findInventTransId(_salesLine.InterCompanyInventTransId);

        }

        if ((icLine.drawingNumberId != _salesLine.DrawingNumberId) || (icLine.DrawingIndexId != _salesLine.DrawingIndexId))

        {

            return #imageWarning;

        }

    }

    return 0;

}

On runtime I get the:
Error executing code: SalesLineDbt_Extension object does not have method 'drawingDifference'.

In control properties the display methode could be selected...
Also the changeCompany() should not be the problem because the same error appears if code only return zero...


So what is wrong? Do I have to reference all packages/modules where form and table extension exists to "myModule"?

  • Christian Busche Profile Picture
    583 on at
    RE: Extension object does not have method

    Hi Nikolaos...

    I removed the parameter and that works very fine... Thank you very much... I thought that a display methode needs this parameter...

  • Christian Busche Profile Picture
    583 on at
    RE: Extension object does not have method

    Hi Nikolaos,

    yes, it is a class that augments SalesLine table as you describe... Also the class and form extension are in the same package...

    Because that there are several more extension of the form, all the extension model must be referenced to "myModel" I thought, ...

    I try to remove the _salesLine parameter and code a "this" instead and let you know the result...

    THX

  • Verified answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Extension object does not have method

    Where is this method defined? Is it in a class that augments SalesLine table? (ExtensionOf(tableStr(SalesLine))? It's very critical information.

    If yes, please try to remove the _salesLine parameter. You should not need it, instead you can use "this" to get data from the table buffer.

    I don't understand your last question. If your form extension and the display method are defined in the same package, you don't need to add any references to make it work. If they are in different packages, the package where the form extension is defined must have reference to the package where the display method is defined.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,961 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,801 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans