PXSelector 属性抑制表单错误
PXSelector attribute suppress Error on form
美好的一天
我已经为仓库位置创建了自定义位置字段:
#region UsrTOLocation
[PXString]
[PXUIField(DisplayName = "To Location")]
[PXSelector(typeof(Search<
INLocation.locationCD,
Where<INLocation.siteID, Equal<Current<INRegister.toSiteID>>>>))]
public virtual string UsrTOLocation { get; set; }
public abstract class usrTOLocation : PX.Data.BQL.BqlString.Field<usrTOLocation> { }
#endregion
当位置不存在时,我使用按钮中的代码创建它。
由于我已将 PXSelector 添加到上述字段中,因此当它找不到位置时,我会不断收到错误消息。这是正确的,因为我还需要创建它
有没有办法抑制找不到位置的错误?
您可以使用 PXSelector 属性的 ValidateValue 属性。
例如:
[PXSelector(..., ValidateValue = false)]
它禁用验证并因此在 PXSelector 属性中出现错误
美好的一天
我已经为仓库位置创建了自定义位置字段:
#region UsrTOLocation
[PXString]
[PXUIField(DisplayName = "To Location")]
[PXSelector(typeof(Search<
INLocation.locationCD,
Where<INLocation.siteID, Equal<Current<INRegister.toSiteID>>>>))]
public virtual string UsrTOLocation { get; set; }
public abstract class usrTOLocation : PX.Data.BQL.BqlString.Field<usrTOLocation> { }
#endregion
当位置不存在时,我使用按钮中的代码创建它。 由于我已将 PXSelector 添加到上述字段中,因此当它找不到位置时,我会不断收到错误消息。这是正确的,因为我还需要创建它
有没有办法抑制找不到位置的错误?
您可以使用 PXSelector 属性的 ValidateValue 属性。
例如:
[PXSelector(..., ValidateValue = false)]
它禁用验证并因此在 PXSelector 属性中出现错误