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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

report not bring all row from HcmPositionWorkerAssignment

(0) ShareShare
ReportReport
Posted on by 2,050

greeting everyon 

i'v created a new report so in my report i wanna show all Position which Assignment to worker but in my report not show me all Position only show me the current like this

pastedimage1581921946837v1.png 

and i need to show all Position like this below 

pastedimage1581921999354v2.png

i'm using normal query but still only show me current Position 

 while select hcmPositionWorkerAssignment where hcmPositionWorkerAssignment.Worker==hcmWorkerRecId
        {
            TransferEmpReportTemp.clear();
            TransferEmpReportTemp.PersonnelNumber=hcmWorker::find(hcmPositionWorkerAssignment.Worker).PersonnelNumber;
            TransferEmpReportTemp.WorkerName=hcmWorker::find(hcmPositionWorkerAssignment.Worker).name();
            TransferEmpReportTemp.Position=hcmPosition::find(hcmPositionWorkerAssignment.Position).description();
            TransferEmpReportTemp.ValidFrom=hcmPositionWorkerAssignment.ValidFrom;
            TransferEmpReportTemp.ValidTo=hcmPositionWorkerAssignment.ValidTo;

            select * from hcmPosition where hcmPosition.RecId==hcmPositionWorkerAssignment.Position;

            select * from hcmPositionDetail
         where hcmPositionDetail.Position==hcmPosition.RecId;

            select * from oMOperatingUnit
        where oMOperatingUnit.RecId==hcmPositionDetail.Department;
        TransferEmpReportTemp.Department=oMOperatingUnit.Name;

            select PaidByLegalEntity from payrollPositionDetails
        where hcmPositionWorkerAssignment.Position==payrollPositionDetails.Position;

            select DataArea from companyInfo
        where payrollPositionDetails.PaidByLegalEntity==companyInfo.RecID;

            TransferEmpReportTemp.Company=companyInfo.Name;

            TransferEmpReportTemp.insert();
        }

how can i allow all row of that table show in my report?!

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi Mohammed,

    hcmPositionWorkerAssignment table is a valid time state table and by default, it only returns records that are valid for the current date.

    If you want to select all records you need to use validTimeState keyword in select statement with date range.  (see example docs.microsoft.com/.../effects-of-valid-time-state-tables-on-read-and-write-operations

    General information: docs.microsoft.com/.../valid-time-state-tables-and-date-effective-data

  • enricoariel Profile Picture
    60 on at

    this is a date effective table. if you select without a date effective range it auto select the current record. To pull all records you need to add the ValidTimeState keyword, like this:

    utcDateTime validTo = DateTimeUtil::maxValue();

    utcDateTime validFrom = DateTimeUtil::minValue();

    while select ValidTimeState(validFrom, validTo) hcmPositionWorkerAssignment where...

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 495 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 315 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans