I am trying to write a validation on creation of a new parent link to prevent a leaf task from having subtasks added to it if the task has labor and/or non-labor resources assigned to it.
It is relatively easy to check for labor resources using this logic:
$Parent.EntityType='Task' && $Parent.ResourcesAndPlaceholdersCount>0
but I can’t see any field against the Parent to indicate explicitly that it has an NLR. I can use something like:
Not IsEmptyOrZero($Parent.BudgetCostNLR) || Not IsEmptyOrZero($Parent.PlannedRevenueNLR
however, this won’t pick up zero cost and revenue NLRs associated with the task.
Does anyone know of a better way to identify if a task has NLRs associated to it?
For information: If I don’t prevent subtasks being added to a task with NLRs, then all the NLRs associated with the new parent task are deleted by the system and ‘lost’ without any warning.
Supplemental question: I selected to use ResourcesAndPlaceholdersCount (# of Resources) to identify if there are labor resources on the task and it seems to work - I also had a choice of using AllUserResourcesCount (# of All User Resources) or UserResourcesCount (# of User Resources). Is there any documentation which explains what is the differences between these 3 standard fields or can anyone just explain it so I can check I’ve used the most correct one?