我创建了一个非常简单的数据输入网格,当我尝试在自定义DAC的属性中分配多个isKey值时,我遇到了问题。我有两个领域,我需要作为一对独特,直接客户和间接客户。当我将IsKey = true添加到Direct / Indirect时,网格功能异常并添加两行,其中一行缺少间接。
当我删除一个Iskey时,网格功能正常,只有在添加第二个键时才会发生错误。我正在尝试使用Direct
在Direct Customer和Indirect Customer上使用两个IsKey = true时,下面添加了空行。
修改SQL表,使直接和间接客户成为主键
钥匙的DAC声明:
#region RecordID
[PXDBIdentity()]
[PXUIField(DisplayName = "Record ID")]
public int? RecordID { get; set; }
public class recordID : IBqlField{}
#endregion
#region DirectCustomer
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Direct Customer")]
[PXSelector(typeof(PX.Objects.AR.Customer.bAccountID),
typeof(PX.Objects.AR.Customer.acctCD),
typeof(PX.Objects.AR.Customer.acctName),
SubstituteKey = typeof(PX.Objects.AR.Customer.acctName))]
public int? DirectCustomer { get; set; }
public class directCustomer : IBqlField{}
#endregion
#region IndirectCustomer
[PXDBString(100,IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Indirect Customer")]
[PXSelector(typeof(Search<PX.Objects.AR.Customer.acctCD,
Where<PX.Objects.CR.BAccountExt.usrIndirectCust, Equal<True>>>),
typeof(PX.Objects.AR.Customer.acctCD),
typeof(PX.Objects.AR.Customer.acctName),
SubstituteKey = typeof(PX.Objects.AR.Customer.acctName))]
public string IndirectCustomer { get; set; }
public class indirectCustomer : IBqlField{}
#endregion