Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Adding HcmWorker Related datasources to data entity

Posted on by 177
Hi Experts. 

I have created a HcmWorker data entity but I only have access to a few fields. 
When i look at the already existing HcmWorkerEntity I can see that it has added a lot of datasources:
 
 

I can see that DirPersonBaseEntity has a lot of relevant fields like FirstName and LastName. But when i look at the NameTabPage Form on the worker page (the form that displays FirstName, LastName and so on..) I can that the FirstName field uses a datasource called DirPersonName (not DirPersonBaseEntity). 

My questions: 
1. How can i see which datasources i should add in my data entity to get full access to all the information i need? Is there an overview of the relationsships somewhere?
2. What is a Dir table?
3. Does anyone know where to find a guide in adding datasources and creating relationsships between them? I havent been able to find a guide on this. 
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    Adding HcmWorker Related datasources to data entity
    You can't remove fields in an extensions, but you normally shouldn't. You're not supposed to change all existing tables, entities and forms and remove all fields that you don't need at the moment. You disable some of them by configuration key, hide by security, or simply ignore.
     
    Note that creating an extension is just one of your options. You can also create a custom entity that uses the standard entity as its data source. Then you don't have to duplicate all logic of the standard entity, while you have a full control on things like the list of fields.
     
    Of course, there may be situations where creating a custom entity is needed, such as when you want to improve performance by removing some parts of the standard entity, but it should be the last resort.
  • CU30040608-0 Profile Picture
    CU30040608-0 177 on at
    Adding HcmWorker Related datasources to data entity
    Thank you for the explanation Martin. 

    I thought about extending the HcmWorkerEntity and adding my custom worker fields to it. But i noticed that when extending the HcmWorkerEntity i was not able to remove the filds that i didnt want to include. On top of that visual studio had a hard time handling it and started laggin extemly :P Would you always extend an existing data entity if one exists? Even though it has a lot of information not needed?
  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    Adding HcmWorker Related datasources to data entity
    Forms usually take data from tables, not data entities. If you have a reason not to use DirPersonBaseEntity, you can open its definition to see which tables it consists of and how they're related.
     
    Ideally, don't create a second entity for the same purpose - use the existing one.
     
    There is no "Dir" table - the core table there is DirPartyTable, which represents a party (an individual or an organization) in general. These may be customers, vendors, legal entities, workers and so on.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans