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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Adding new class attribute on standard class by extension

(0) ShareShare
ReportReport
Posted on by 310

Hi experts,

I would like to know, is there any way to add new class attribute on standard class by extension method.

For example, below is the standard implementation of PurchReqDocument class, and now I want to add new attribute ExpressionHierarchyProviderAttribute for my new field of PurchReqLine table which is also referrenced from EcoResCategory.RecId.

[
WorkflowDocIsQueueEnabledAttribute(true,"@SYS152689"),
ExpressionHierarchyProviderAttribute(classStr(PurchReqExpressionProvider), tableStr(PurchReqLine), fieldStr(PurchReqLine,ProcurementCategory)),
ExpressionCurrencyFieldMapAttribute('parmApprovalAmount', 'parmCurrencyCode'),
ExpressionCurrencyFieldMapAttribute('parmApprovalAmountExclTax', 'parmCurrencyCode'),
ExpressionCurrencyFieldMapAttribute('parmSpendingLimit', 'parmCurrencyCode'),
ExpressionCurrencyFieldMapAttribute('parmSpendingLimitPreparer', 'parmCurrencyCode')
]
class PurchReqDocument extends WorkflowDocument implements SysErrorMessageHelpScopeIWorkflow
{

...

...

}

-Thanks

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi Arif, Can you try adding new field attribute as specified below. I have not tested the functionality but compiler is not giving any errors.

    pastedimage1684063807599v1.png

    [
        ExpressionHierarchyProviderAttribute(classStr(PurchReqExpressionProvider), tableStr(PurchReqLine), fieldStr(PurchReqLine,TestField))
    ]
    [ExtensionOf(classStr(PurchReqDocument))]
    public final class PurchReqDocument_C_Extension
    {
    }

  • Arif Vadsarya Profile Picture
    310 on at

    Hi Mohit,

    Thanks for quick reply.

    Compilation is successful but system is not picking this attribute for PurchReqDocument class.

  • Mohit Rampal Profile Picture
    12,573 Moderator on at

    I couldn't find any document or example in standard class for this scenario. Can you try below code, it might be limitation that we can't add new attribute by extension but can't confirm it.

    [
    WorkflowDocIsQueueEnabledAttribute(true,"@SYS152689"),
    ExpressionHierarchyProviderAttribute(classStr(PurchReqExpressionProvider), tableStr(PurchReqLine), fieldStr(PurchReqLine,ProcurementCategory)),
    ExpressionCurrencyFieldMapAttribute('parmApprovalAmount', 'parmCurrencyCode'),
    ExpressionCurrencyFieldMapAttribute('parmApprovalAmountExclTax', 'parmCurrencyCode'),
    ExpressionCurrencyFieldMapAttribute('parmSpendingLimit', 'parmCurrencyCode'),
    ExpressionCurrencyFieldMapAttribute('parmSpendingLimitPreparer', 'parmCurrencyCode'),
    ExpressionHierarchyProviderAttribute(classStr(PurchReqExpressionProvider), tableStr(PurchReqLine), fieldStr(PurchReqLine,TestField))
    ]
    [ExtensionOf(classStr(PurchReqDocument))]
    public final class PurchReqDocument_C_Extension
    {
    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 722

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 605 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 547

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans