Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / InitFrom... method in ...
Finance forum

InitFrom... method in Extensions

(0) ShareShare
ReportReport
Posted on by 621

Hi

I created an extension to the purchline table (new field) and I want to set a value during the initFromProject method. Therefore I created a class where I added the post-eventhandler for the initFromProjTable Method

How can I now access the projTable parameter passed to the base method?

  • Verified answer
    Martin Dráb Profile Picture
    232,970 Most Valuable Professional on at
    RE: InitFrom... method in Extensions

    A much easier and safer approach is using Chain of Command - then you can simply refer the parameter by name and you don't have to hard-code parameter names as text (or parameter index).

    Here is an example:

    [ExtensionOf(tableStr(PurchLine))]
    final class MyPurchLine_Extension
    {
        void initFromProjTable(ProjTable _projTable, boolean _updateSalesPriceOnly)
        {
            next initFromProjTable(projTable, updateSalesPriceOnly);
            
            this.MyField = _projTable.MyField;
        }
    }
  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: InitFrom... method in Extensions

    Since you talk about extensions, I guess your question is about D365FO, not AX. I will move this post to the correct forum.

    You can get the parameter from the event args, by calling args.getParm("parameterName");

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: InitFrom... method in Extensions

    Hi,

    Are you working with AX2012 or D365FO?

    Best regards,

    Ludwig

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... 294,208 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,970 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans