在SOOrder屏幕上设置当前用户登录的默认仓库选择器值,其中用户具有角色



这是我对SiteID的编码(自定义现有字段)

 [PXDefault(typeof(Search<PX.SM.RelationGroup.groupName,InnerJoin<PX.SM.Users, On<PX.SM.RelationGroup.groupMask,Equal<PX.SM.Users.groupMask>>,InnerJoin<INSite, On<PX.SM.RelationGroup.groupName,Equal<INSite.siteCD>>>>,Where<PX.SM.Users.pKID, Equal<Current<AccessInfo.userID>>>>),PersistingCheck = PXPersistingCheck.Nothing)]

发布项目时出现错误:

 error CS0311: The type 'PX.Data.Where<PX.SM.Users.pKID,PX.Data.Equal<PX.Data.Current<PX.Data.AccessInfo.userID>>>' cannot be used as type parameter 'OrderBy' in the generic type or method 'PX.Data.Search<Field,Where,OrderBy>'. There is no implicit reference conversion from 'PX.Data.Where<PX.SM.Users.pKID,PX.Data.Equal<PX.Data.Current<PX.Data.AccessInfo.userID>>>' to 'PX.Data.IBqlOrderBy'.
 error CS0311: The type 'PX.Data.InnerJoin<PX.SM.Users,PX.Data.On<PX.SM.RelationGroup.groupMask,PX.Data.Equal<PX.SM.Users.groupMask>>,PX.Data.InnerJoin<PX.Objects.IN.INSite,PX.Data.On<PX.SM.RelationGroup.groupName,PX.Data.Equal<PX.Objects.IN.INSite.siteCD>>>>' cannot be used as type parameter 'Where' in the generic type or method 'PX.Data.Search<Field,Where,OrderBy>'. There is no implicit reference conversion from 'PX.Data.InnerJoin<PX.SM.Users,PX.Data.On<PX.SM.RelationGroup.groupMask,PX.Data.Equal<PX.SM.Users.groupMask>>,PX.Data.InnerJoin<PX.Objects.IN.INSite,PX.Data.On<PX.SM.RelationGroup.groupName,PX.Data.Equal<PX.Objects.IN.INSite.siteCD>>>>' to 'PX.Data.IBqlWhere'.

在此处输入图像描述

看起来您错误地修改了 PXDefault 属性。

如果要使用 BQL 设置默认值,则必须使用搜索而不是 PXSelect

请参阅下面的示例

[PXDefault(typeof(Search<SOOrderType.iNDocType, Where<SOOrderType.orderType, Equal<Current<SOLineSplit.orderType>>>>), PersistingCheck = PXPersistingCheck.Nothing)]

最新更新