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, ...
Answered

Post load method in d365fo

(0) ShareShare
ReportReport
Posted on by 30

Hi

If I need to add virtual field in standard data entity then I have to write code in PostLoad method.

So, to write code in PostLoad method,  I need required to create an extension of data entity like

For example:

[ExtensionOf(tableStr(SalesOrderHeaderV2Entity))]
final class Myclass_SalesOrderHeaderV2Entity_Extension
{

    public void postload()
    {
       // Custom code

         next postload();

      // Custom code

    }

}

Is it right approach?

Please Give me more shed on this

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,053 Super User 2025 Season 2 on at

    Hi Arpan,

    This is possible. It looks like the documentation, so give it a try: docs.microsoft.com/.../method-wrapping-coc

  • Verified answer
    Blue Wang Profile Picture
    on at

    Hi @rp@n,

    Yes, you can do it.

    [ExtensionOf(tableStr(SalesOrderHeaderV2Entity))]
    final class SWClass_SalesOrderHeaderV2Entity_Extension
    {
       
    
        public void postload()
        {
            next postload();
           
            SalesOrderHeaderV2Entity SalesOrderHeaderV2Entity = this;
           
    
            SalesTable                  salesTable = SalesTable::find(SalesOrderHeaderV2Entity.SalesOrderNumber);
    
           
            SalesOrderHeaderV2Entity.customdate  = date2Str(salesTable.createddateandtime, 213,
                                                                    DateMonth::Digits2,
                                                                    DateSeparator::Slash,
                                                                    DateDay::Digits2,
                                                                    DateSeparator::Slash,
                    DateYear::Digits4);
            }
                   
        }
    
    }

    https://rahulmsdax.blogspot.com/2019/06/how-to-extend-or-overwrite-dataentity.html

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 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans