web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

DIXF - Workers, Positions and Position Hierarchy

(0) ShareShare
ReportReport
Posted on by 506

Using DIXF, there doesn't seem to be a straightforward way of getting workers imported with positions that have a hierarchy.

My best shot to date imports workers using the Employee entity without referencing JobId or PositionId.

Then I import positions using the Position entity specifying the personnel number of the worker (HcmWorker_WorkerPersonnelNumber). Here I also specify the parent position and hierarchy type (e.g. "Line"). This is to build the hierarchy of positions.

This does everything bar the hierarchy, i.e.

Workers setup

Positions setup as active

Positions linked to Workers by worker position assignment records

I've tried to re-import the same Position staging data over the top again, thinking that it is chicken-and-egg with Positions not being written before Parent positions can be established.

However, here I get an error "Cannot edit a record in Position worker assignments (HcmPositionWorkerAssignment). The 'Assignment end' value needs to be greater than or equal to the 'Assignment start' value."

I have tried a lot of different ways too many to list all, but notably other problems include getting the hierarchy correctly imported but unfortunately overwriting the Position assignment records in the process. This happens when first creating the Position via the Employee import (referencing just the PositionId here).

Any suggestions welcomed!

*This post is locked for comments

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

    Hi MGP,

    Did you try to first load all the positions including the parent position and second the workers with position?

  • _MGP Profile Picture
    506 on at

    Hi Andre,

    Thanks for the suggestion. This is how I solved the problem(s).

    I've tried importing 2 positions. 1 parent and 1 child position.

    Case 1
    -Import 1 parent position and 1 child position together in same file (tried different ordering, same result).
    -File header: PositionId, HcmPositionHierarchy_ParentPositionId, HcmPositionHierarchyType_Name
    -Positions in AX are imported 'inactive', no hierarchy as 'Reports to position' not populated in AX. HcmPositionHierarchy table populated but ParentPosition fields are zero.

    Case 2
    -Import parent position, then import child position as separate files
    -File header: PositionId, HcmPositionHierarchy_ParentPositionId, HcmPositionHierarchyType_Name
    -Positions in AX are imported 'inactive', hierarchy is present and 'Reports to position' populated as expected.

    Case 3
    -Import parent position, then import child position as separate files
    -File header: PositionId, HcmPositionHierarchy_ParentPositionId, HcmPositionHierarchyType_Name, HcmPositionDuration_ValidFrom
    -Positions in AX are imported 'active', hierarchy is present and 'Reports to position' populated as expected.

    -Import Employees that match the positions
    -File header: PersonnelNumber, Active, ActiveFrom, ApproveGroupId, CalculateGroupId, DefaultCalculateGroupId, DefaultProfileId, Email, FirstName, HolidaysPerYear, JobId, LastName, LegalEntity, LoginCardNo, MaxHoursCalendar, MiddleName, Name, PeriodDataAreaId, PositionId, ProfileGroupId, ProjPeriodId, PromptForAction, RegistrationSetupId, RequireStartStopTime, UseTimeCard, WorkerStartDate

    Note that in DmfEmployeeEntityClass, generatePosition() will be mapped and will run when JobId is part of the import. However, if a position is found then the positionWorkerAssignment is not generated.

    In the DmfHcmPositionDetailEntityClass, I added the following code between the if and the else statements to get around this:

    else if(_stagingToTarget && hcmPosition.RecId)
    {
        positionWorkerAssignment.initValue();
        positionWorkerAssignment.Worker = HcmWorker::findByPersonnelNumber(entity.PersonnelNumber).RecId;
        positionWorkerAssignment.Position = hcmPosition.RecId;
        positionWorkerAssignment.ValidFrom = DateTimeUtil::getSystemDateTime();
        positionWorkerAssignment.ValidTo = DateTimeUtil::maxValue();
        positionWorkerAssignment.insert();
    }

    This generates the assignment records so that the Workers are assigned to the Positions when the Employee import is run.

    Unfortunately, I can't seem to run an import for parent positions and child positions in the same processing group, even if I assign different Source data formats that are required to make the form validate. When I run the 'Get staging data' process it only runs the 1st migration setup in the processing group. Checking 'Execute sequentially' makes no difference either.

  • André Arnaud de Calavon Profile Picture
    301,329 Super User 2025 Season 2 on at

    I had done it about three years ago without these issues. A lot could have been changed which could lead to your issues. I can't exactly remember what entities were available and how they were used. I can remember we had to change the Employee entity for at least removing some mandatory fields on the staging for tables we were not using.

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

News and Announcements

Season of Giving Solutions is Here!

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Nakul Profile Picture

Nakul 2

#3
Umar-Usman Profile Picture

Umar-Usman 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans