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

时间:2016-07-07 03:14:08

标签: customization acumatica

我刚刚在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 个答案:

答案 0 :(得分:0)

UsersUsersInRoles DAC位于PX.SM命名空间中。 您应该使用using PX.SM;或者每次为PX.SM.UsersInRoles.username

指定这些类的命名空间

P.S。在您的示例中,某些字母的大小写不正确:

UsersInRoles.userName - &gt; UsersInRoles.username

Users.userName - &gt; Users.username

Users.PKID - &gt; Users.pKID