我想通過角色中的用戶在當前用戶登錄時在SOOrder屏幕上設置默認OrderType。所以我在屏幕訂單類型:SO201000上創建新的字段,選擇角色名稱。例如:OrderType:用於userRole:001A的C1和用於userRole:001D的OrderType:C2。錯誤CS0426:「PX.Objects.SO.SOOrderType」類型中不存在類型名稱'UsrUserRole'
在屏幕上的訂單類型:SO201000和UsrUserRole(新領域)
[PXDBString(64)]
[PXDefault()]
[PXSelector(typeof(Search2<PX.SM.Roles.rolename>))]
[PXUIField(DisplayName="User Role", Visibility = PXUIVisibility.SelectorVisible)]
在屏幕上SOOrder:訂單類型(自定義現有域)
[PXDefault(typeof(Search2<SOOrderType.orderType,InnerJoin<PX.SM.UsersInRoles, On<PX.SM.UsersInRoles.rolename, Equal<SOOrderType.UsrUserRole>>>,Where<PX.SM.UsersInRoles.username, Equal<Current<AccessInfo.userName>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
默認訂單類型(自定義現有域)
[PXSelector(typeof(Search5<SOOrderType.orderType,InnerJoin<SOOrderTypeOperation, On<SOOrderTypeOperation.orderType, Equal<SOOrderType.orderType>, And<SOOrderTypeOperation.operation, Equal<SOOrderType.defaultOperation>>>,LeftJoin<SOSetupApproval, On<SOOrderType.orderType, Equal<SOSetupApproval.orderType>>>>,Aggregate<GroupBy<SOOrderType.orderType>>>),DescriptionField = typeof(SOOrderTypeT.descr))] [PXRestrictor(typeof(Where<SOOrderTypeOperation.iNDocType,NotEqual<INTranType.transfer>, Or<FeatureInstalled<FeaturesSet.warehouse>>>), ErrorMessages.ElementDoesntExist, typeof(SOOrderType.orderType))]
[PXRestrictor(typeof(Where<SOOrderType.requireAllocation, NotEqual<True>, Or<AllocationAllowed>>), ErrorMessages.ElementDoesntExist, typeof(SOOrderType.orderType))]
[PXRestrictor(typeof(Where<SOOrderType.active,Equal<True>>), null)]
它不夠清楚嗎? – YSP