当尝试从自定义DAC类中删除属性时,出现“无法找到实体类型”错误。我在一个页面使用的图形中使用DAC,该页面允许用户将属性添加到自定义DAC。我创建的页面类似于“联系和潜在客户类别”页面-CR207000。
这是我要为其分配属性的DAC。
[Serializable]
public class MyCustomGroup : IBqlTable
{
#region CustomGroupID
[PXDBIdentity(IsKey = true)]
[PXUIField(DisplayName = "Custom Group")]
[PXSelector(typeof(MyCustomGroup.CustomGroupID),
typeof(MyCustomGroup.descr),
typeof(MyCustomGroup.capacity),
DescriptionField = typeof(MyCustomGroup.descr))]
public virtual int? CustomGroupID { get; set; }
public abstract class CustomGroupID : IBqlField { }
#endregion
#region NoteID
[PXSequentialNote(new Type[0], SuppressActivitiesCount = true)]
[PXUIField(DisplayName = "Noteid")]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : IBqlField { }
#endregion
#region Descr
[PXDBString(60, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Descr")]
[PXDefault("<New>")]
public virtual string Descr { get; set; }
public abstract class descr : IBqlField { }
#endregion
#region Capacity
[PXDBInt()]
[PXUIField(DisplayName = "Capacity")]
public virtual int? Capacity { get; set; }
public abstract class capacity : IBqlField { }
#endregion
#region Tstamp
[PXDBTimestamp()]
[PXUIField(DisplayName = "Tstamp")]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : IBqlField { }
#endregion
#region CreatedByID
[PXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : IBqlField { }
#endregion
#region CreatedByScreenID
[PXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : IBqlField { }
#endregion
#region CreatedDateTime
[PXDBCreatedDateTimeUtc]
[PXUIField(DisplayName = "Created Date Time")]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : IBqlField { }
#endregion
#region LastModifiedByID
[PXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : IBqlField { }
#endregion
#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : IBqlField { }
#endregion
#region LastModifiedDateTime
[PXDBLastModifiedDateTimeUtc]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : IBqlField { }
#endregion
}
我在Graph类中使用它来填充页面上的“属性”网格:
public CSAttributeGroupList<MyCustomGroup, MyCustomGroupLinker> AttGrpMapping;
这是我在上面的CSAttributeGroupList中使用的第二个自定义DAC:
[Serializable]
public class MyCustomGroupLinker : IBqlTable
{
#region LinkerID
[PXDBIdentity(IsKey = true)]
[PXUIField(DisplayName = "Linker ID")]
public virtual int? LinkerID { get; set; }
public abstract class linkerID : IBqlField { }
#endregion
#region GroupNoteID
[PXDBGuid()]
[PXUIField(DisplayName = "Custom Group")]
[PXSelector(typeof(MyCustomGroup.noteID),
SubstituteKey =typeof(MyCustomGroup.descr))]
public virtual Guid? GroupNoteID { get; set; }
public abstract class groupNoteID : IBqlField { }
#endregion
#region RelatedNoteID
[PXDBGuid()]
[PXUIField(DisplayName = "Related Note ID")]
public virtual Guid? RelatedNoteID { get; set; }
public abstract class relatedNoteID : IBqlField { }
#endregion
}
感谢您的帮助!