Acumatica Acuminator在行Selected/Initialize事件中使用bql查询时发出警告,在何处使用它们?

Acumatica Acuminator在行Selected/Initialize事件中使用bql查询时发出警告,在何处使用它们?,acumatica,Acumatica,我正在使用userLoginType和userRoles来启用/禁用我所选事件行中的某些字段,但使用Acuminator我得到了PX1049警告: 我的代码如下: public class OpportunityMaintExt : PXGraphExtension<OpportunityMaint> { public PXSelectJoin<EPLoginType, InnerJoin<Users, On<Users.loginTypeID, Equal

我正在使用userLoginType和userRoles来启用/禁用我所选事件行中的某些字段,但使用Acuminator我得到了PX1049警告:

我的代码如下:

public class OpportunityMaintExt : PXGraphExtension<OpportunityMaint>
    {
public PXSelectJoin<EPLoginType, InnerJoin<Users, On<Users.loginTypeID, Equal<EPLoginType.loginTypeID>>>,
            Where<Users.pKID, Equal<Current<AccessInfo.userID>>>> userLoginType;
        public PXSelect<Contact, Where<Contact.userID, Equal<Current<AccessInfo.userID>>>> userContact;
        public PXSelect<UsersInRoles, Where<UsersInRoles.username, Equal<Current<AccessInfo.userName>>>> userRoles;
        public string userLoginTypeName;

protected virtual void CROpportunity_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            CROpportunity o = e.Row as CROpportunity;
            CROpportunityExt myOpp = sender.GetExtension<CROpportunityExt>(sender.Current);
            userLoginTypeName = TRLoginInfo.getCurrentUserLoginType(userLoginType.SelectSingle(), userRoles);
enabledisablefields();
}
公共类OpportunityMaintExt:pxGrapherExtension
{
公共PXSelectJoin用户登录类型;
公共联系人选择用户联系人;
公共用户选择用户角色;
公共字符串userLoginTypeName;
已选择受保护的虚拟无效裁剪机会(PXCache发件人、PXRowSelectedEventArgs e)
{
CROPORTUNITY o=e。行作为CROPORTUNITY;
croportunityext myOpp=sender.GetExtension(sender.Current);
userLoginTypeName=TRLoginInfo.getCurrentUserLoginType(userLoginType.SelectSingle(),userRoles);
enabledisablefields();
}
问题在于userLoginType.SelectSingle()中,Acuminator告诉我:“在Rowselected处理程序中,应该避免bql和数据库查询”。但是如果我将其放在Initialize()中,它会给出相同的警告

那么,如果我想在观看记录时处理这些bql/数据库查询,我应该将它们放在哪里


非常感谢!

理想情况下-您应该在新PXConnectionScope内的行选择事件中触发BQL(行选择事件中的BQL必须在新PXConnectionScope内执行以防止问题发生),在DAC扩展中分配非db支持的字段,然后在RowSelected事件中使用这些字段的值来确定是否应启用某些字段