Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Adding new parameter to Datacontract class through class extensions

Posted on by 110

I would like to add a new parameter to the Datacontract class through extension.
But I am getting an error stating "The DataMemberAttribute is not supported on Extension Class"

[Extensionof(classStr(VendInvAPCommonFileContract))]
final class VendInvoiceAPCommonFileContract_Extension
{
public boolean excludePreviouslyClosed;

public void initialize()
{

next initialize();

excludePreviouslyClosed = false;
}

[
DataMemberAttribute,
SysOperationLabelAttribute('ExcludePreviouslyClosed')
]
public NoYesId parmExcludePreviouslyClosed(NoYesId _excludePreviouslyClosed = excludePreviouslyClosed)
{
excludePreviouslyClosed = _excludePreviouslyClosed;
return excludePreviouslyClosed;
}

Could someone please suggest some alternate way to add the above parameter ??

*This post is locked for comments

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Adding new parameter to Datacontract class through class extensions

    Hi manasa133,

    As of today it is not possible via extensions, the only possible workaround is to create new data contract and use it instead.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans