我刚刚在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)
请帮助!!!
答案 0 :(得分:0)
Users
和UsersInRoles
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