Monday, August 28, 2017

Get Report to Position

HcmPositionRecId                        SelfPosition;
HcmPositionHierarchy                    PositionHierarchy;
uctdatetime utcDT = dtatimeutlill::;
SelfPosition = HcmPositionWorkerAssignment::find(HcmWorkerPrimaryPosition::findByWorker(HcmWorker::findByPerson("current person").RecId).PositionAssignment).Position;
    select validTimeState(utcDT) PositionHierarchy
    where PositionHierarchy.Position  == SelfPosition  && PositionHierarchy.PositionHierarchyType != 0;
    report to postion = HcmWorker::find(HcmWorkerPrimaryPosition::findByPositionAssignment(HcmPositionWorkerAssignment::findByPosition(PositionHierarchy.ParentPosition).RecId).Worker).Person;

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...