PXSelector属性抑制表单错误

问题描述 投票:0回答:1

美好的一天

我为仓库位置创建了一个自定义位置字段:

    #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,所以当找不到位置时,我会不断收到错误消息。这是正确的,因为我仍然需要创建它

是否有一种方法可以抑制找不到位置的错误?

acumatica
1个回答
1
投票

您可以使用PXSelector属性的ValidateValue属性。

例如:

    [PXSelector(..., ValidateValue = false)]   

它禁用验证,因此在PXSelector属性中出现错误

© www.soinside.com 2019 - 2024. All rights reserved.