What attribute can be used to allow unique values, we used [PXUniqueCheck(typeof(Name))] But if List view is used and records are updated with same name, it allows the same name values
More Details - HI, Column is marked with IsKey = True for Name, My View is ListView, with 2 fields Name and Description where Name has IsKey =True and another column ID has DBIdentity Attribute. SO i think there is everything OK with the DAC, UI Add Behavior - when existing value is added then it updates the old row with newly added value description as Name is Same. Update Behavior - Change name column to the same value as of other then it allows to have 2 rows with same Key, but both rows shows the same description on UI, but in DB there are 2 rows with same Name value and different Description
DAC -
[System.SerializableAttribute()]
[PXPrimaryGraph(typeof(TestCategoryMaint))]
public class TestCategory : PX.Data.IBqlTable
{
#region TestCategoryID
public abstract class testCategoryID : PX.Data.BQL.BqlInt.Field<testCategoryID>
{
}
protected int? _TestCategoryID;
[PXDBIdentity()]
[LicenseExpiration]
[PXReferentialIntegrityCheck]
public virtual int? TestCategoryID
{
get
{
return this._TestCategoryID;
}
set
{
this._TestCategoryID = value;
}
}
#endregion
#region Name
public abstract class name : PX.Data.IBqlField
{
}
protected string _Name;
[PXDBString(50, IsKey = true, IsUnicode = true, InputMask = "")]
[PXDefault()]
[PXUIField(DisplayName = "Test Category")]
[PXCheckUnique(typeof(name))]
public virtual string Name
{
get
{
return this._Name;
}
set
{
this._Name = value;
}
}
#endregion
#region Description
public abstract class description : PX.Data.IBqlField
{
}
protected string _Description;
[PXDBString(255,IsUnicode =true)]
[PXUIField(DisplayName = "Description")]
public virtual string Description
{
get
{
return this._Description;
}
set
{
this._Description = value;
}
}
#endregion