Skip to main content
Question

enforce unique field value on workitem

  • June 16, 2026
  • 3 replies
  • 39 views

Forum|alt.badge.img

We have added a custom text field and want to set up a validation or workflow rule to prevent duplicates at the parent task level. While we successfully implemented a duplicate-blocking rule for the client object using the findcustomer function, we noticed that an equivalent function is not available for the workitem object.

Could someone assist us in finding a solution or suggest an alternative approach?

3 replies

Forum|alt.badge.img+1
  • Planview Falcons
  • June 19, 2026

Hi ​@amougari 

There is no Find function for workitems in Workflow that can be used to search for specific fields. However, there may be a few other ways you can achieve this.

Validation Rule on Parent/Project Field

If the text value needs to be unique from the Parent then you can access the parent record directly.

For example:

  • Let’s call the work item custom field “Unique Id” (with API name $C_UniqueId)
  • On the task, have a validation rule that runs whenever the Unique Id field is changed
    • The rule evaluates if the new value of the tasks Unique Id matches the parent object’s Unique Id field (ie $C_UniqueId = $Parent.C_UniqueID)
    • If that matches, then return a message stating that you can’t set that value.

You can apply the same logic to the $Project field (or any other reference to object field that matches)

Use a custom action to change the field

Another option is to use a Custom Action to control updating that field. Custom Actions allow you to search for records based on field criteria using the FindObject function; this function is not availabe in Workflows.

In the CA you can set a variable to reference a Work Item, and use the FindObject function to return an object that matches your critieria: FindObject('WorkItem', $C_UniqueId, ‘Value to check’) - where ‘Value to check’ is the unique value. Based on that outcome you can use a conditional actio to either update the field value, or notify the user that the value already exists.

Use AdaptiveWork to set the Unique Value

If the value can be autogenerated then you can use the AdaptiveWork Counters GetNextCounterValue function to return a unigue number, and use that in the field creation.

 

Post back here on how you get on!

 


Forum|alt.badge.img
  • Author
  • June 29, 2026

Hi ​@petegush ,

Thank you for your response. While we appreciate the solution provided, it does not fully address our specific requirements. The suggested approach compares `$C_UniqueID` with `$Parent.C_UniqueID`, whereas what we need is different. 

Here is our use case:

Structure:
  - Project→ Level 0
  - Task 1→ Level 1 (under the Project)
  - Task 2→ Level 1 (under the same Project)

-Goal:
  - Compare `$C_UniqueID1` (from Task 1) with `$C_UniqueID2` (from Task 2) under the same Project.
  - Ensure that `$C_UniqueID1 != $C_UniqueID2`.

Additional condition:
  - The child elements of parent tasks can inherit the `$C_UniqueID` of their respective parents.

Please let us know if there is an alternate approach to achieve this requirement. Thank you!


Forum|alt.badge.img+1
  • Planview Falcons
  • June 29, 2026

Hi ​@amougari 

Thanks for providing a clearer context of your requirements. Based on this description we cannot use a validation rule to check the duplication as we can’t loop through the other task in the VR. The good new is we can use a Workflow Rule (WFR) to do this check!

I have understood that your project has direct child tasks, and it is at this level that we want to prevent the duplication of the Unique ID between tasks (ie across all tasks that are directly under the project).

You can create a WFR on the task that triggers when the unique ID field is changed on the task (identified as a task where the parent object is a project).

An example of the actions in the WFR could be:

  • Create a variable and set an initial value (eg NULL)
  • Update the variable and run on the sub items of the parent (ie Parent then Sub Items) - this will then look at all the items that are directly under the Project at the same level as the task
  • Add a filter to the Run On to only include items where the target object Unique ID field equals the current tasks Unique ID field (eg TargetObject.C_UniqueID = $C_UniqueID); ie we are looking at any other children of the parent that have the same Unique ID
  • If a match is found then update the variable; if no match is found then the variable value will stay as the original set value (eg NULL)
  • Then use a conditional action and check if the variable value is still the original value or not
  • If it is not the original value then in the conditional action use a Notify action to let the user know the value is used elsewhere (and provide any other details about the other task that would help the user); then use a Set Field action to change the Unique ID on the task back to it’s previous value.
  • If the value is the original value then the conditional action is skipped and no changes are made.

This should point you in the right direction on this requirement; let us know how you get on!

Pete