Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Select statement with certain fields

$
0
0

The below piece of code exists in the class PayrollEarningGenerationTask, method   createWorkerPositionRecurringEarnings

 

 

 

if (workerRecId != 0&& positionRecId != 0&& positiondetail.RecId != 0)

    {

        select validTimeState(toDateTime) RecId from positionWorkerAssignment

                where positionWorkerAssignment.Worker == workerRecId

                && positionWorkerAssignment.Position == positionRecId;

 

        if (positionWorkerAssignment.RecId != 0)

        {

            //

            // can have multiple earning records exist for a given worker and position combination at the endDate of the pay period

            // and the calc frequency is defined for the pay period

            //

            whileselect validTimeState(toDateTime) RecId, Worker, Position, EarningCode, Formula, CalculationFrequency from workerPositionEarningCode

                where workerPositionEarningCode.Position == positionWorkerAssignment.Position

                    && workerPositionEarningCode.Worker == positionWorkerAssignment.Worker

                    && workerPositionEarningCode.CalculationFrequency != 0

                join RecId, CalculationFrequencyId from calculationFrequency

                    where calculationFrequency.RecId == workerPositionEarningCode.CalculationFrequency

                // only calculate those with calculation frequency defined for this period

                outerjoin RecId, PayPeriod from calculationFrequencyPayPeriod

                    where calculationFrequencyPayPeriod.CalculationFrequency == workerPositionEarningCode.CalculationFrequency

                        && calculationFrequencyPayPeriod.PayPeriod == payPeriodRecId

 

 

I notice that positionWorkerAssignment.Position, positionWorkerAssignment.Worker are filled with values although they are not selected in the first select statement only RecId is retrieved, such case is strange   can I find an explanation for this ?


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>