PO处于打开状态时,如何在PO301000上启用自定义字段? [英] How to enable a custom field on PO301000 when the PO is in Open status?

查看:61
本文介绍了PO处于打开状态时,如何在PO301000上启用自定义字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在PO Entry屏幕PO.30.10.00中添加了自定义项。该自定义添加了四个日期字段,一个组合框文本字段和一个string(10)字段。

I have added a customization to the PO Entry screen, PO.30.10.00. The customization adds four date fields, a combobox text field, and a string(10) field.

现在,这些字段仅在PO处于保留状态时才可编辑。用户希望能够随时编辑这些字段。他们正在使用这些字段来跟踪不同的PO,并将基于它们进行通用查询,以便他们可以通过维护这些字段来传达PO的状态。

Right now, the fields are only editable when the PO is on hold. The user wants to be able to edit these fields at any time. They are using these fields to keep track of different POs and will build Generic Inquiries on them so they can communicate the statuses of the POs by maintaining these fields.

承诺日期PO处于打开状态时可编辑。我们希望这些自定义字段像承诺日期一样可编辑。

The Promise Date is editable when the PO is in Open status. We would like these custom fields to be editable like the Promise Date is.

推荐答案

采购订单屏幕在很大程度上受自动化步骤驱动。这个事实使对自动化步骤的更改成为在PO处于打开状态时启用自定义字段所必需的强制性步骤:

The Purchase Orders screen is heavily driven by Automation Steps. This fact makes changes to automation steps a mandatory step needed to enable a custom field when the PO is in Open status:

要在购买订单摘要区域和文档详细信息网格上启用自定义文本字段,应修改 NL Open 步骤通过添加2行,如上面的屏幕截图所示。

To enable Custom Text Fields on the Purchase Order Summary area and the Document Details grid, one should modify the NL Open step by adding 2 lines as shown in the screenshot above.

添加完这些行后,自定义文本字段在购买订单摘要区域变为可编辑但是,由于在POOrderEntry BLC中如何实现POLine_RowSelected处理程序,因此文档详细信息网格中的自定义文本字段列仍然是只读的:

After you added those lines, Custom Text Field becomes editable on the Purchase Order Summary area, however, the Custom Text Field column is still read-only in the Document Details grid because of how POLine_RowSelected handler is implemented in the POOrderEntry BLC:

[Serializable]
public class POOrderEntry : PXGraph<POOrderEntry, POOrder>, PXImportAttribute.IPXPrepareItems
{
    ...
    protected virtual void POLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
    {
        POLine row = (POLine)e.Row;
        POOrder doc = this.Document.Current;
        if (row == null) return;

        if (IsExport) return;//for performance 

        bool isLinkedToSO = row.Completed == true && IsLinkedToSO(row);

        if (this.Document.Current.Hold != true || isLinkedToSO)
        {
            PXUIFieldAttribute.SetEnabled(sender, e.Row, false);
            ...
        }
        ...
    }
    ...
}

要启用自定义文本字段列进行编辑,您还应该在POOrderEntry BLC扩展中订阅POLine_RowSelected处理函数,如下面的代码片段所示:

To enable the Custom Text Field column for editing, you should additionally subscribe to POLine_RowSelected handler within your POOrderEntry BLC extension as shown in the code snippet below:

public class POOrderEntryExt : PXGraphExtension<POOrderEntry>
{
    public void POLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
    {
        POLine line = (POLine)e.Row;
        POOrder order = Base.Document.Current;
        if (order == null || line == null || Base.IsExport) return;

        if (order.Status == POOrderStatus.Open)
        {
            PXUIFieldAttribute.SetEnabled<POLineExt.usrCustomTextField>(sender, line, true);
        }
    }
}

对自动化进行更改后步骤并订阅POOrderEntry BLC扩展内的POLine_RowSelected处理程序,应在打开PO时打开采购订单摘要区域和文档详细信息网格上的自定义字段以进行编辑打开状态:

Once you made changes in Automation Steps and subscribed to POLine_RowSelected handler within a POOrderEntry BLC extension your custom fields on both the Purchase Order Summary area and the Document Details grid should be open for editing when the PO is in Open status:

这篇关于PO处于打开状态时,如何在PO301000上启用自定义字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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