Hi all,
Hoping you can help - I'm very new to X++ and I have the following:
WorkflowTrackingStatusTable workflowTrackingStatusTable;
WorkflowTrackingTable workflowTrackingTable;
WorkflowStepEntity workflowStepEntity;
select firstonly1 workflowTrackingStatusTable
join WorkflowTrackingTable
join workflowStepEntity
order by WorkflowTrackingTable.TrackingDateTimeTickCount desc
where workflowTrackingStatusTable.ContextTableId == _tableId
&& workflowTrackingStatusTable.ContextCompanyId == _companyId
&& workflowTrackingStatusTable.ContextRecId == _recId
&& workflowTrackingStatusTable.RecId == workflowTrackingTable.WorkflowTrackingStatusTable
&& workflowTrackingTable.ElementId == workflowStepEntity.ElementId
;
PositionHierarchy positionHierarchy;
str depot = PositionHierarchySupport::GetDepot(_tableId, _recId);
select positionHierarchy
where positionHierarchy.WorkflowLevel == workflowStepEntity.ParticipantTokenName
&& positionHierarchy.Depot == depot
;
if (positionHierarchy.RecId)
{
POSITIONHIERARCHYLIMITS positionHierarchyLimits;
select positionHierarchyLimits
where positionHierarchyLimits.WorkflowLevel == positionHierarchy.WorkflowLevel
&& positionHierarchyLimits.WorldTerritory == positionHierarchy.WorldTerritory
;
if (positionHierarchyLimits.RecId)
{
return positionHierarchyLimits.ApprovalAmount;
}
}
return (0);
The first two selects work as expected but the third (on PoistionHierarchyLimits) doesn't return anything, even though I run the query in SQL and it's fine.
Any idea on what I'm missing here, I'm going a bit mad with it :-\
Thanks in advance
*This post is locked for comments
I have the same question (0)