Post

2 followers Follow
0
Avatar

Resources On CurrentObject()

I am trying to develop a Custom action that first looks to see if the item is a task and that the task has no resources assigned.

I can't seem to figure out the logic. CurrentObject() doesn't allow nested values, GetLink will only find one item so I would have to check every user.

Ideally it would be "currentobject().resourcecount=0" but obviously this is not a legitimate rule.

Does anyone have any ideas?

Josh Boutwell Answered

Please sign in to leave a comment.

3 comments

0
Avatar

Hi Josh,

If the custom action is on the task, all you need to do is use $ResourceCount. Since the Custom Action is probably on a WorkItem you are already in the context of CurrentObject().

Let me know if it makes sense.

Regards,
Tamir

Tamir Avital 0 votes
Comment actions Permalink
0
Avatar

That was it! Why is it always the simple things that stump me...

I do have a related question. In my custom action I need to see if the current user has the skill identified in the C_Skill field on the task. How would I check if a skill was in the set of skills held by a resource?

Josh Boutwell 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

You need to use the GetLink function.
Within that context you would use GetLink('SkillLink',$C_Skill,CurrentUser())<>NULL

Let me know if that solves for the problem.

Regards,
Tamir

Tamir Avital 0 votes
Comment actions Permalink