这是我对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'.
答案 0 :(得分:0)
您似乎错误地修改了PXDefault属性。
如果要使用BQL设置默认值,则必须使用搜索而不是PXSelect
请参阅下面的示例
[PXDefault(typeof(Search<SOOrderType.iNDocType, Where<SOOrderType.orderType, Equal<Current<SOLineSplit.orderType>>>>), PersistingCheck = PXPersistingCheck.Nothing)]