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

Notifications

Announcements

No record found.

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,093 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans