I imported a test set of worker records but the workers are not viewable in any of the forms in AX. I suspect it's due to the code that 'hires' the worker upon selecting the 'Hire new worker' button when manually entering new workers. Is there a bit of code that needs to be run after importing workers to 'hire' them? Thanks
*This post is locked for comments
According to my knowledge, there should be two data entities. One for Worker and another for the data into corresponding HcmEmployment table. The standard entity for Worker in D365 doesn't import data into HcmEmployment.
My research indicates entries are required in DirPersonName, DirPartyRelationship, DirPerson,DirPartyTable,HCMWorker,HCMEmployment tables. I tried creating a worker and using that as a template but I kept receiving errors when trying to import to AX7. In the end I had to resort to manually entering data so that all the PartyIds and relationships get created, then export, edit with additional fields, then import. As a side note, try changing first name, middle name, last name or personnel number after a record has been created. It appears that you can't so you have to delete and then create again. Therefore you had best be sure all the names are correct before getting any transactions on your employee / workers.
Thanks Andre. I asked an MSFT AX solutions architect about this issue and the way he suggested handling it is to create a data entity specifically to execute the 'Hire' code. This is beyond my technical capability so I'm going to work with one of our developers on it.
BTW, I checked the hcmWorkers table and the imported data is there. However, the records do not yet exist in the hcmEmployees table, which indicated to me that there is code behind the 'Hire' button that populates one or more other hcm tables.
The employees and contractor forms in AX7 are only showing data if these persons do have an employment for the current legal entity. The workers form should display all workers, but there might be some dependency on date effective values. Like Sohaib mentioned, check the employment records.
When you import data using the data entities, in many cases you need to alter ome settings like enabling run business logic on inserting records. The form to to this is a bit hidden. I can check how to do this tomorrow.
I suspect it may be missing record(s) in HcmEmployment Table. Each work should have one active record in this table.
Thanks for the responses Sohaib and Chris. I imported using DMF in AX7.
I don't have access to SSMS on the VM right now so I wasn't able to check that Chris but I will when I get to a non-firewalled world.
Manually enter one worker and compare the data between one you manually entered and one you imported. Do the comparison using SQL Query or the Table Browser in AX. This could tell you where you need to either map additional fields in DIEF or add extra code in the entity class for your DIEF entity. Another option is to debug what the code is looking for when clicking the hires button in AX as this can tell you where in the data you need to look for differences. good luck
How you have imported data?
by DIXF or custom code etc?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156