-->

在采购订单中查找屏幕添加所有者名称(Adding Owner Name in the Purchas

2019-10-29 05:29发布

我想在采购订单>订单树木包添加所有者名称(在PO屏幕)。 现场查找屏幕。 我试图在数据类的OrdNbr手动添加以下,但它并没有在查找屏幕带来的员工姓名。 你能帮帮或让我知道,如果我失去了一些东西。 下面是完整的代码我试图(截图附后)

[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))]

非常感谢在这里输入图像描述

Answer 1:

由于POOrder.employeeID在它的定义中PXSelector属性:

而这种选择分配有DescriptionField:

在这种情况下,你可以通过添加这行代码到你的CacheExtension文件(这将获得DescriptionField为雇员ID字段)添加站点名称:

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场不会有“DescriptionField”关于PXSelector定义设置,你将不得不修改OrderNbr的PXSelector添加LeftJoin需要的表(在这种情况下CREmployee),所以你可以使用所需的字段,并把它们添加到PXCustomizeSelectorColumns属性。



文章来源: Adding Owner Name in the Purchase Order Lookup screen
标签: acumatica