Skip to main content
Planview Customer Success Center

Configurable Field Settings page fails with error when selecting an entity based code field

Symptoms


Find ProjectCode524 in Configurable Field Settings page in System Manager. Page fails with the following error:

Error/warning messages
[ArgumentException: These columns don't currently have unique values.]
System.Data.ConstraintCollection.AddUniqueConstraint() +1922576
System.Data.ConstraintCollection.Add() +161
System.Data.DataTable.set_PrimaryKey() +507
Changepoint.BusinessServices.ConfigurableFields.UDFCondFieldFormula.GetCondFieldFormulaLists() +2243

[Exception: These columns don't currently have unique values.]
Changepoint.BusinessServices.ConfigurableFields.UDFCondFieldFormula.GetCondFieldFormulaLists() +3583
Changepoint.SystemManager.UserInterface.CustomCodeDetails.LoadCodeItem() +5754
Changepoint.SystemManager.UserInterface.CustomCodeDetails.Page_Load() +5222
System.EventHandler.Invoke() +0
System.Web.UI.Control.OnLoad() +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain()+2207


Reason

The existing filter formula for the code field does not return unique values:

SELECT Customer.CustomerId, Customer.FullName AS Name FROM Customer WITH (NOLOCK) join CustomerRelation on customer.CustomerId = CustomerRelation.ChildCustomerId and deleted = 0

If conditional values or properties are created for such code fields with filter statement returning non-unique values, Configurable Field Settings page will fail with error in UI.


 

Resolution

Use the following statement to update the filter formula, so that the filter statement returns unique items:

update titledefinition set formula = 'SELECT Customer.CustomerId, Customer.FullName AS Name FROM Customer WITH (NOLOCK) where exists (select 1 from CustomerRelation where customer.CustomerId = CustomerRelation.ChildCustomerId) and deleted = 0' where item = 'projectcode524'