Hello everyone, I created a table with the following script.
CREATE TABLE [dbo].[GDLFAVehicleDetails](
[CompanyId] [int] NOT NULL,
[AssetId] [int] NOT NULL,
[VehicleRegNo] [nvarchar](50) NOT NULL,
/***other fields left out***/
CONSTRAINT [PK_GDLFAVehicleDetails] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC,
[AssetId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [IX_GDLFAVehicleDetails_1] UNIQUE NONCLUSTERED
(
[VehicleRegNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
I needed to make VehicleRegNo to accept only unique values
so I added Iskey= true on the DAC as shown below;
However when I add the Iskey=true value the user input disappears, when I remove it user input does not disappear on the UI and user is able to save the input entered.
What could be the issue?
#region VehicleRegNo
[PXDBString(50,IsKey =true, IsUnicode = true)]
[PXDefault]
[PXUIField(DisplayName = "Vehicle Reg No.")]
public virtual string VehicleRegNo { get; set; }
public abstract class vehicleRegNo : PX.Data.BQL.BqlString.Field<vehicleRegNo>
{
}
#endregion
Kindly asist
Any kind of response will be highly appreciated.