在采购订单查找屏幕中添加所有者名称

时间:2017-11-13 15:03:31

标签: acumatica

我想在采购订单>订单Nbr中添加所有者名称(在采购订单屏幕上)。字段查找屏幕。我尝试在OrdNbr的数据类中手动添加以下内容,但它没有在查找屏幕中显示Employee名称。如果我遗失了什么,你能帮忙或让我知道吗? 这是我正在尝试的完整代码(附带截图)

[PXCustomizeSelectorColumns(
typeof(PX.Objects.PO.POOrder.orderType),
typeof(PX.Objects.PO.POOrder.orderNbr),
typeof(PX.Objects.PO.POOrder.vendorRefNbr),
typeof(PX.Objects.PO.POOrder.orderDate),
typeof(PX.Objects.PO.POOrder.status),
typeof(PX.Objects.PO.POOrder.vendorID),
typeof(PX.Objects.PO.POOrder.vendorID_Vendor_acctName),
typeof(PX.Objects.PO.POOrder.vendorLocationID),
typeof(PX.Objects.PO.POOrder.curyID),
typeof(PX.Objects.PO.POOrder.curyOrderTotal),
typeof(PX.Objects.PO.POOrder.sOOrderType),
typeof(PX.Objects.PO.POOrder.sOOrderNbr),
typeof(PX.Objects.PO.POOrder.orderDesc),
typeof(PX.Objects.CR.CREmployee.acctCD),
typeof(PX.Objects.CR.CREmployee.bAccountID),
typeof(PX.Objects.CR.CREmployee.acctName))]

非常感谢enter image description here

1 个答案:

答案 0 :(得分:0)

由于POOrder.employeeID在其定义上具有 PXSelector 属性:

enter image description here

此Selector分配了 DescriptionField

enter image description here

在这种情况下,您可以通过将此行代码添加到CacheExtension文件来添加所有者名称(这将获取EmployeeID字段的DescriptionField):

public abstract class employeeID_CREmployee_acctName : PX.Data.IBqlField { }

请参阅下面的代码段:

namespace PX.Objects.PO
{
    [PXNonInstantiatedExtension]
    public class PO_POOrder_ExistingColumn : PXCacheExtension<PX.Objects.PO.POOrder>
    {
        #region OwnerName
        public abstract class employeeID_CREmployee_acctName : PX.Data.IBqlField
        { }
        #endregion

        #region OrderNbr    
        [PXMergeAttributes(Method = MergeMethod.Append)]

        [PXCustomizeSelectorColumns(
            typeof(PX.Objects.PO.POOrder.orderType),
            typeof(PX.Objects.PO.POOrder.orderNbr),
            typeof(PX.Objects.PO.POOrder.vendorRefNbr),
            typeof(PX.Objects.PO.POOrder.orderDate),
            typeof(PX.Objects.PO.POOrder.status),
            typeof(PX.Objects.PO.POOrder.employeeID),
            typeof(PX.Objects.PO.PO_POOrder_ExistingColumn.employeeID_CREmployee_acctName),
            typeof(PX.Objects.PO.POOrder.vendorID),
            typeof(PX.Objects.PO.POOrder.vendorID_Vendor_acctName),
            typeof(PX.Objects.PO.POOrder.vendorLocationID),
            typeof(PX.Objects.PO.POOrder.curyID),
            typeof(PX.Objects.PO.POOrder.curyOrderTotal),
            typeof(PX.Objects.PO.POOrder.sOOrderType),
            typeof(PX.Objects.PO.POOrder.sOOrderNbr))]
        public string OrderNbr { get; set; }
        #endregion
    }
}

请注意,如果 POOrder.EmployeeID 字段没有在 PXSelector 定义中设置“ DescriptionField ”,您将拥有修改 OrderNbr 的PXSelector以在所需表格上添加 LeftJoin (在此案例中为 CREmployee ),以便您可以使用所需的字段和将它们添加到 PXCustomizeSelectorColumns 属性。