Acumatica - 图形扩展

Acumatica - Graph Extension

先生/女士,您好,

如果这个问题已经在社区中提出过,请原谅我问这个问题,但我似乎找不到正确的答案来解决我的问题。

我有一个包含 2 个自定义视图的扩展图,即 ReservationDetails 和 PropertyItems

图表

    public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
    {
            #region Selects

            public PXSelect<RECOReservationDetail,
                                Where<RECOReservationDetail.reservationNbr,
                                    Equal<Current<SOOrder.orderNbr>>>> ReservationDetails;


            public PXSelectReadonly<InventoryItem,
                                Where<InventoryItem.inventoryID,
                                    Equal<Current<RECOReservationDetail.inventoryID>>>> PropertyItems;
            #endregion
    }

DAC

[Serializable]
    public class RECOReservationDetail : IBqlTable
    {

        #region Reservation Nbr.

        [PXDBString(15, IsKey = true)]
        [PXUIField(DisplayName = "Reservation Nbr.")]
        [PXDefault()]
        public virtual string ReservationNbr { get; set; }
        public abstract class reservationNbr : IBqlField { }

        #endregion

        #region Branch ID

        [PXDBInt]
        [PXSelector(typeof(Search<Branch.branchID>),
                    SubstituteKey = typeof(Branch.branchCD))]
        [PXUIField(DisplayName = "Branch ID", Required = true)]
        [PXDefault(typeof(AccessInfo.branchID), PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual int? BranchID { get; set; }
        public abstract class branchID : IBqlField { }

        #endregion

        #region Inventory ID

        [StockItem]
        [PXUIField(DisplayName = "Inventory ID", Required = true)]
        public virtual int? InventoryID { get; set; }
        public abstract class inventoryID : IBqlField { }

        #endregion

        #region Salesperson ID

        [PXDBInt]
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        [PXUIField(DisplayName = "Salesperson ID")]
        [PXSelector(typeof(Search<SalesPerson.salesPersonID>),
                    SubstituteKey = typeof(SalesPerson.salesPersonCD))]
        public virtual int? SalespersonID { get; set; }
        public abstract class salespersonID : IBqlField { }

        #endregion

        #region Quantity

        [PXDBDecimal(2)]
        [PXUIField(DisplayName = "Quantity", Enabled = false)]
        [PXDefault(TypeCode.Decimal, "1.0", PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual decimal? ItemQty { get; set; }
        public abstract class itemQty : IBqlField { }

        #endregion

        #region Reservation Fee

        [PXDBDecimal(2)]
        [PXUIField(DisplayName = "Reservation Fee")]
        [PXDefault(TypeCode.Decimal, "0.0", PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual decimal? ReservationFee { get; set; }
        public abstract class reservationFee : IBqlField { }

        #endregion

        #region Reservation Cash Disc.

        [PXDBDecimal(2)]
        [PXUIField(DisplayName = "Reservation Cash Disc.")]
        [PXDefault(TypeCode.Decimal, "0.0", PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual decimal? ReservationCashDiscAmt { get; set; }
        public abstract class reservationCashDiscAmt : IBqlField { }

        #endregion

        #region Amount

        [PXDBDecimal(2)]
        [PXUIField(DisplayName = "Amount")]
        [PXDefault(TypeCode.Decimal, "0.0", PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual decimal? ReservationAmt { get; set; }
        public abstract class reservationAmt : IBqlField { }

        #endregion

        #region Product Type
        [PXDBString(15)]
        [PXDefault(ProductTypes.Lot, PersistingCheck = PXPersistingCheck.Nothing)]
        [PXStringList(
            new string[] {
                ProductTypes.HouseConstruction,
                ProductTypes.HouseLot,
                ProductTypes.HouseLotAdjacentLot,
                ProductTypes.Lot
            },
            new string[] {
                "House Construction",
                "House & Lot",
                "House & Lot with Adjacent Lot",
                "Lot"
            })]
        [PXUIField(DisplayName = "Product Type")]
        public virtual string ProductType { get; set; }
        public abstract class productType : IBqlField { }
        #endregion
    }

现在,当我尝试更改页面中的库存 ID 时出现问题,它会清除页面上所有控件的值。

BEFORE I change the Inventory ID

AFTER I changed the Inventory ID

每次更改库存 ID 时,控件上的记录都会被清除。

我只是不明白我在扩展图表时哪里出错了。

谢谢你,我希望你能帮助我解决这个问题。

更新 - 10/01/2018

This is the whole layout for the page. I have inputted the order nbr / reservation nbr, but the inventory id at the detail section still clears everything whenever i try filling it out.

我也试过更换页面的库存id控件,还是没有解决问题。

最终更新

我终于解决了这个问题。我不知道为什么,但在我将 PxParent 属性放在我的预订 nbr 上后,它解决了子选项卡上的清除问题。非常感谢您提供的所有帮助。快乐编码!

#region Reservation Nbr.

        [PXDBString(15, IsKey = true)]
        [PXUIField(DisplayName = "Reservation Nbr.")]
        [PXParent(typeof(Select<SOOrder, 
                            Where<SOOrder.orderNbr, 
                                Equal<Current<RECOReservationDetail.reservationNbr>>>>))]
        [PXDBDefault(typeof(SOOrder.orderNbr))]
        public virtual string ReservationNbr { get; set; }
        public abstract class reservationNbr : IBqlField { }

#endregion

我通过在 DAC 的 ReservationNbr 上添加 PXParent 属性解决了这个问题。虽然我不明白为什么它有效。 (^_^)

    #region Reservation Nbr.

    [PXDBString(15, IsKey = true)]
    [PXUIField(DisplayName = "Reservation Nbr.")]
    [PXParent(typeof(Select<SOOrder, 
                        Where<SOOrder.orderNbr, 
                            Equal<Current<RECOReservationDetail.reservationNbr>>>>))]
    [PXDBDefault(typeof(SOOrder.orderNbr))]
    public virtual string ReservationNbr { get; set; }
    public abstract class reservationNbr : IBqlField { }

    #endregion

非常感谢您提供的所有帮助。快乐编码! :)