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 :
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,565 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,565 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans