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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to add additional parameter to the local macro using extension class in D365FO

(0) ShareShare
ReportReport
Posted on by 302

Hello,

I want to add a new element to the already defined Local macro without using overlay.

Is it possible? If so how to achieve this?

I wanted to add new element to below macro in class SalesFormLetterInvoiceContract.

#define.CurrentVersion(1)
    #LOCALMACRO.ParmListSalesInvoice
        backorder,
        queryCriteria,
        editing,
        printerSettingsBillOfExchange
        // <GEEU>
        ,ltDocNumberingCode        
        // </GEEU>
    #ENDMACRO


Please guide me on this.

Thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Wekey,

    Macros are not extensible, however, if you need to extend pack\unpack you may use RunBase.packExtension(), please refer for details https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/extend-runbase-class

  • Wekey Profile Picture
    302 on at

    Thanks for your help ievgen.

  • Community Member Profile Picture
    on at

    Hi ievgen,

    I am trying to add additional macro in extension class(ProjLedger). ProjLedger class is not extending RunBaseBatch.

    It's giving me below errors:-

    Class 'ProjLedger' does not contain a definition for method 'unpackExtension' and no extension method 'unpackExtension' accepting a first argument of type 'ProjLedger' is found on any extension class.

    Class 'ProjLedger' does not contain a definition for method 'packExtension' and no extension method 'packExtension' accepting a first argument of type 'ProjLedger' is found on any extension class.
    Please guide me.

    Thanks!

  • Mea_ Profile Picture
    60,284 on at

    It has static method inside, just use it:

    SysPackExtensions::unpack(_args, _extensionName);

  • Community Member Profile Picture
    on at

    Hi Sukrut,

    I am trying to add in existing list.

    Best regards!

  • Community Member Profile Picture
    on at

    Thanks ievgen,

    After using SysPackExtensions::unpack(_args, _extensionName) format. The extension class errors are resolved.

    But now I am getting below errors.

    Macro-in-extension-class.JPG

    Macro-in-extension-class.JPG

  • Mea_ Profile Picture
    60,284 on at

    Something is wrong with you macro, what do you have there ?

  • Community Member Profile Picture
    on at

    Below is the code:-

    [ExtensionOf(classstr(ProjLedger))]

    public final class ProjLedgerARP_Extension

    {

       private CBS2WBSRelationship  CBS2WBSRelationship;

       #DEFINE.CurrentVersion(1)

       #LOCALMACRO.CurrentList

           CBS2WBSRelationship

        #ENDMACRO

    Thanks!

  • Mea_ Profile Picture
    60,284 on at

    You cannot put a class or any reference type into container.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans