我面临以下问题:我创建了一个用户字段“ UsrBranch”。
使用“ SO财务设置”中的“分支”查找,我可以选择并将其保存到新的“ UsrBranch”字段中,但是即使我将字段设置为“ Required = false”,它也使该字段成为必填字段。范例1:
[PXUIField(DisplayName = "Branch")]
[Branch(typeof(Coalesce<Search<Location.cBranchID,
Where<Location.bAccountID, Equal<Current<SOOrder.customerID>>,
And<Location.locationID, Equal<Current<SOOrder.customerLocationID>>>>>,
Search<Branch.branchID, Where<Branch.branchID,
Equal<Current<AccessInfo.branchID>>>>>), Required = false)]
public virtual Int32? UsrBranch { get; set; }
public abstract class usrBranch : PX.Data.BQL.BqlString.Field<usrBranch> { }
如果将查找更改为PXSelector,它将显示“分支”,但是我无法选择任何分支。示例2:
[PXUIField(DisplayName = "Branch")]
[PXSelector(typeof(Branch.branchID),
SubstituteKey = typeof(Branch.branchCD))]
public virtual Int32? UsrBranch { get; set; }
public abstract class usrBranch : PX.Data.BQL.BqlString.Field<usrBranch> { }
非常感谢您的帮助。
“必需”属性控制星形是否将出现在UI的字段中。 PXDefaultAttribute上的“ PersistingCheck”属性控制值是否是必需的。