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

how to add code on entity .

(0) ShareShare
ReportReport
Posted on by 1,479
I am working on  the entity name projectEntity having table projectstaging ,what i need to do is when the data is to be exported using entity there the value of project id is there  and it populated and the same value is pass to project contract id , what i need do is code on entity so if there is value in contract id available then it should take the value of contract id  else the value of project id is pass to the contract id .can any one plz guide me on this ,  i have not done this before .
 
thanks ,
Regards
Dinesh
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,479 on at
    how to add code on entity .
    hi ,
    thanks for reply ,
    i have made extension and code on post load method of entity my code is below.
    [ExtensionOf(tableStr(ProjectEntity))]
    final class DTProjectEntity_Extension
    {
        public void postLoad()
        {
            next  postLoad();
    
            if(this.ProjectContractID == '')
            {
                this.ProjectContractID = this.ProjectID;
            }
        }
    }
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 231,403 Most Valuable Professional on at
    how to add code on entity .
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,715 Super User 2025 Season 1 on at
    how to add code on entity .
    Hi Dinesh,
     
    Maybe create an extension for this method "MapDatasourceToEntity" and put your logic there about the contract and the project. Let us know if it works.
     
    Also please make sure to close your other threads and verify answers.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans