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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    Thanks for your help ievgen,

    This code is not giving any error in 8.1 preview.

    This issue is resolved.

    Best regards!

    Richa

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    Thanks ievgen!

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    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
    Mea_ 60,278 on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    Hi Sukrut,

    I am trying to add in existing list.

    Best regards!

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    It has static method inside, just use it:

    SysPackExtensions::unpack(_args, _extensionName);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add additional parameter to the local macro using extension class in D365FO

    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!

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans