【问题标题】:Acumatica Customize Process Shipments Add branch field from PO ReceiptsAcumatica 自定义流程发货从 PO 收据添加分支字段
【发布时间】:2021-09-17 09:40:56
【问题描述】:

我试图弄清楚是否可以在选择“准备档案发票”操作时,是否可以将字段添加到流程运输屏幕上的网格中。具体来说,我想添加 POReceipts.BranchID 字段。

我研究了源代码,并看到了根据所选操作运行不同选择命令的位置,但我不明白是什么驱动网格显示不同的列集。

我在自定义编辑器中查看了屏幕设计器,但没有看到不同的视图或任何东西,希望我只是遗漏了一些简单的东西。

谢谢 斯科特

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    这就是我解开你的谜团的方法。首先为 SOSshipment 创建一个用户字段。

        #region UsrReceiptBranchID
        [PXInt]
        [PXUIField(DisplayName="Receipt Branch ID")]
        [GL.Branch()]
    
        public virtual int? UsrReceiptBranchID { get; set; }
        public abstract class usrReceiptBranchID : PX.Data.BQL.BqlInt.Field<usrReceiptBranchID> { }
        #endregion
    

    接下来是关键部分。当过滤器为 Drop-Ship 时,我扩展了数据视图委托,并添加了一个额外的查询来拉取 POReceipt 分支。

        public virtual IEnumerable orders()
        {
            List<SOShipment> records = Base.orders().RowCast<SOShipment>().ToList();
            if (Base.Filter.Current.Action.Contains("Drop"))
            {
                foreach (SOShipment sOShipment in records)
                {
                    POReceipt receipt = PXSelect<POReceipt,
                        Where<POReceipt.receiptNbr,
                        Equal<Required<POReceipt.receiptNbr>>>>.Select(Base, sOShipment.ShipmentNbr);
                    if (receipt != null)
                    {
                        SOShipmentExt shipExt = PXCache<SOShipment>.GetExtension<SOShipmentExt>(sOShipment);
                        shipExt.UsrReceiptBranchID = receipt.BranchID;
                    }
                }
                return records;
            }
            else
            {
                return records;
            }
        }
    

    【讨论】:

    • 克里斯,非常感谢您在这方面的帮助。当我在 usrReceiptBranchID 字段的 dac 扩展上有行 [GL.Branch()] 时,我收到此错误。 “错误:输入表单(ID:SO302000,标题:Shipments)无法自动化。无效的列名'[SOShipment_SOShipment]。[UsrReceiptBranchID]'它编译得很好,但是除非我删除了该行,否则我在访问屏幕时会收到该错误。有什么想法吗?再次感谢。
    • 我用这个选择器属性替换了 [GL.Branch()] 属性,这似乎解决了我的问题。 [PXSelector(typeof(GL.Branch.branchID), SubstituteKey = typeof(GL.Branch.branchCD), DescriptionField = typeof(GL.Branch.acctName))]
    猜你喜欢
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    • 2021-11-07
    • 1970-01-01
    • 2017-11-18
    • 1970-01-01
    • 2022-01-25
    • 2022-01-06
    相关资源
    最近更新 更多