在采购订单查找屏幕中添加所有者名称 [英] Adding Owner Name in the Purchase Order Lookup screen

查看:90
本文介绍了在采购订单查找屏幕中添加所有者名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在采购订单>订单Nbr中添加所有者名称(在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))]

非常感谢



该选择器具有分配的 DescriptionField





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

 公共抽象类employeeID_CREmployee_acctName:PX.Data.IBqlField {} 

请参见摘录

 命名空间PX.Objects.PO 
{
[PXNonInstantiatedExtension]
公共类PO_POOrder_ExistingColumn:PXCacheExtension< PX.Objects.PO.POOrder>
{
#region OwnerName
公共抽象类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对象rder.curyID),
typeof(PX.Objects.PO.POOrder.curyOrderTotal),
typeof(PX.Objects.PO.POOrder.sOOrderType),
typeof(PX.Objects.PO .POOrder.sOOrderNbr))]
公共字符串OrderNbr {get;组; }
#endregion
}
}

请注意如果 POOrder.EmployeeID 字段未在 PXSelector 定义中设置 DescriptionField ,则必须修改 OrderNbr 在所需表上添加 LeftJoin (在这种情况下为 CREmployee ),因此您可以使用所需的字段并将其添加到 PXCustomizeSelectorColumns 属性。


I would like to add the Owner Name (on the PO Screen) in the Purchase Order>Order Nbr. field lookup screen. I tried to manually add the following in the Data Class for OrdNbr but it didn't bring the Employee name in the lookup screen. Can you please help or let me know if i am missing something. Here is the full code i am trying(screenshot attached)

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

Many Thanksenter image description here

解决方案

Since POOrder.employeeID has a PXSelector attribute on its definition:

And this Selector has a DescriptionField assigned:

On this case you can add Owner name by adding this line of code to your CacheExtension file(This will obtain that DescriptionField for the EmployeeID field):

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

See Snippet below:

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
    }
}

Please notice that in case the POOrder.EmployeeID field would not have the "DescriptionField" set on the PXSelector Definition, you would have to modify the PXSelector of the OrderNbr to add a LeftJoin on the Desired Table(CREmployee on this case) so you could use the desired fields and add them to the PXCustomizeSelectorColumns attribute.

这篇关于在采购订单查找屏幕中添加所有者名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆