Acuamtica 案例附加网格不显示关系网格中的所有 PXSelect 相关数据行

问题描述 投票:0回答:1

使用下面的 Acumatica 代码,我能够有条件地在案例屏幕中创建一个新网格;但是,PXSelect 命令并未显示网格中的所有行。 我想要做的是基于“关系”获取 CRRelation.targetNoteID 的值并将所有 ARRegister 数据拉入一个名为“CAM 信息”的新网格中。但是“CAM 信息”图表视图仅显示“关系”的第一行,而不是所有其他行。 (请参阅屏幕截图以供参考) 我需要如何编写 Acumatica 代码来查找、选择和显示“CAM 信息”网格中的所有行?

using System.Collections.Specialized;
using System.Linq;
using PX.Common;
using PX.Data;
using System.Collections;
using PX.Data.EP;
using PX.Objects.AR;
using PX.Objects.CT;
using PX.Objects.CR.Workflows;
using PX.Objects.GL;
using PX.Objects.EP;
using PX.Objects.IN;
using PX.Objects.PM;
using PX.SM;
using PX.TM;
using PX.Objects;
using PX.Objects.CR;
using System.Net.Http;
using System.Collections.Generic;
using System.Collections;

namespace PX.Objects.CR
{

  public class CRCaseMaint_Extension : PXGraphExtension<CRCaseMaint>
  {     
      
     
    #region Event Handlers
        protected virtual void CRCase_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
          {
            InvokeBaseHandler?.Invoke(cache, e);
            var row = (CRCase)e.Row;
            if (row != null)
              {
                if (row.CaseClassID == "CAM")
                  {
                    PXUIFieldAttribute.SetVisible<Objects.CR.CRCaseExt.usrRMAReason>(cache, row, false);
                    PXUIFieldAttribute.SetVisible<Objects.CR.CRCaseExt.usrSupportCategory >(cache, row, false);
                    PXUIFieldAttribute.SetVisible<Objects.CR.CRCaseExt.usrContractDesc>(cache, row, false);
                    PXUIFieldAttribute.SetVisible<Objects.CR.CRCaseExt.usrCaseStage>(cache, row, false);
                    PXUIFieldAttribute.SetVisible<Objects.CR.CRCaseExt.usrIGAHEquipmentID>(cache, row, false);                 
                  }
                

              } 
            
          } 
  
    #endregion
               
        
    // Following view delaration populates the ARRegister info; but only one line            
    #region Selects  
       public PXSelect<ARRegister, Where<ARRegister.noteID, Equal<CurrentValue<CRRelation.targetNoteID>>>> CAMRelationsView;
    #endregion
             
 
      
  }
}```
[![Cases Relations Tab grid][1]][1]
[![Cases CAM Info Tab grid][2]][2]


  [1]: https://i.stack.imgur.com/m4KA0.jpg
  [2]: https://i.stack.imgur.com/CBYNQ.jpg
c# acumatica
1个回答
0
投票

声明视图不正确。你需要这样声明

public PXSelect<ARRegister, Where<ARRegister.noteID, Equal<Current<CRRelation.targetNoteID>>>> CAMRelationsView; 

另外,你还需要设置2个设置

    关系网格的
  1. SyncPosition
    应设置为
    true
  2. AutoCallBack
    事件上,您需要使用网格
    ID
    .
  3. 为您自己的网格视图编写动态更新

Current<Field>
- 从缓存的
Current
属性插入字段值。如果
Current
属性为null或字段值为null,参数将被替换为默认值。
CurrentValue<Field>
- 等同于
Current
参数,但用于
PXProjection
属性。

© www.soinside.com 2019 - 2024. All rights reserved.