代码之家  ›  专栏  ›  技术社区  ›  YSP

找不到(是否缺少using指令或程序集引用?)

  •  0
  • YSP  · 技术社区  · 10 年前

    我刚刚在SOOrder屏幕上创建了新字段,并希望将当前用户登录的默认值userRole输入到该文本框中,但上面出现了错误。这是我的编码:

     //Layout Editor: SO301000 (Sales Orders)
     [PXDBString(64)]
     [PXDefault(typeof(Coalesce<Search<UsersInRoles.userName,  Where<UsersInRoles.userName, Equal<Current<AccessInfo.userName>>>>, 
            Search<BAccount.ownerID, Where<BAccount.bAccountID, Equal<Current<SOOrder.customerID>>>>>), 
            PersistingCheck = PXPersistingCheck.Nothing)]
     [PXUIField(DisplayName="Current User" , Enabled = false)]
    
     error: Cannot implicitly convert type 'PX.Data.PXResultset' to 'PX.SM.UsersInRoles' in file: Code#SOOrderEntry(80)
     error: 'PX.Data.PXRowSelectingEventArgs' does not contain a definition for 'NewValue' and no extension method 'NewValue' accepting a first argument of type 'PX.Data.PXRowSelectingEventArgs' could be found (are you missing a using directive or an assembly reference?) in file: Code#SOOrderEntry(83)
    

    1 回复  |  直到 10 年前
        1
  •  0
  •   Dmitrii Naumov    10 年前

    Users 和 UsersInRoles DAC位于 PX.SM 您应该使用 using PX.SM; PX.SM.UsersInRoles.username

    附言:您示例中的一些字母大小写不正确:

    UsersInRoles.userName -> UsersInRoles.username

    Users.userName -> Users.username

    Users.PKID -> Users.pKID

    推荐文章