You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Acumatica:为EPApproval数据网格添加跨表虚拟字段报错

Hey there! Let's break down how to fix this issue you're having with adding the UsrSubID virtual field to the EPApproval data grid.

First, let's unpack the error

The message The type name 'usrSubID' does not exist in the type 'PX.Objects.RQ.RQRequest' points to two likely root causes:

  • The custom UsrSubID field hasn’t been properly published to the RQRequest Data Access Class (DAC)
  • You’re using the wrong case or reference syntax for the field in your PXDBScalar logic

Step 1: Confirm the custom field exists and is published

  1. Open your Acumatica customization project
  2. Navigate to Customization > Dictionary > Tables > RQRequest
  3. Check if the UsrSubID field is listed here. If not, add it (or verify it was added correctly in another project)
  4. Make sure you’ve published the customization project—this generates the code needed to attach the field to the RQRequest DAC

Step 2: Fix the PXDBScalar implementation

In Acumatica, custom fields use a specific BQL naming convention: the abstract field class is camelCase (matching the lowercase start of your custom field’s name). Here’s a corrected version of your extension class:

using PX.Data;
using PX.Objects.EP;
using PX.Objects.RQ;

public class EPApprovalExtension : PXCacheExtension<EPApproval>
{
    // Virtual field pulling UsrSubID from RQRequest
    [PXDBScalar(typeof(Search<RQRequest.usrSubID, 
        Where<RQRequest.noteID, Equal<EPApproval.refNoteID>>>))]
    [PXUIField(DisplayName = "Sub ID")] // Add a user-friendly display name
    public virtual string UsrSubID { get; set; }

    // BQL field definition for the virtual field
    public abstract class usrSubID : PX.Data.BQL.BqlString.Field<usrSubID> { }
}

Step 3: Add the field to the EPApproval grid

Once the extension is ready:

  1. Open the EPApproval screen in the customization editor
  2. Locate the data grid where you want the field to appear
  3. Add a new column, set its Data Field to usrSubID (matching the abstract class name in your extension)
  4. Republish the customization to apply all changes

Quick checks to avoid common pitfalls

  • Double-verify the join condition: RQRequest.noteID = EPApproval.refNoteID only works if every EPApproval record links to a RQRequest via refNoteID. If some approvals aren’t tied to requests, consider handling null values.
  • Ensure you’re referencing the correct namespaces (PX.Objects.RQ for RQRequest, PX.Objects.EP for EPApproval).
  • If UsrSubID was added to a DAC extension of RQRequest (not the base DAC), adjust your search to reference the extension:
    [PXDBScalar(typeof(Search<RQRequestExt.usrSubID, 
        Where<RQRequest.noteID, Equal<EPApproval.refNoteID>>>))]
    

内容的提问来源于stack exchange,提问作者Fillip Kamati

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:56:51