【问题标题】:Acumatica - Graph ExtensionAcumatica - 图形扩展
【发布时间】:2019-03-04 04:43:35
【问题描述】:

先生/女士,您好,

如果社区中已经有人提出过这个问题,请原谅我提出这个问题,但我似乎无法为我的问题找到正确的答案。

我有一个扩展图,其中包含 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 时,控件上的记录都会被清除。

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

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

更新 - 2018 年 10 月 1 日

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.

我也尝试过替换页面上的inventory 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

【问题讨论】:

  • 我没有看到记录中填写的关键字段? ReservationNbr 及其价值在哪里?如果它基于销售订单号,您需要确保为 ReservationNbr 字段添加销售订单号的默认值。正如你在它上面只是空的并且没有显示在字段上所以行的键永远不会被填写。
  • 你好@Brendan,谢谢你的建议。我通过输入预订 nbr / 销售订单号尝试了您所说的内容,但无济于事,每当我输入库存 ID 时,它都会清除子选项卡上的所有内容。我上传了上面的图片以供参考。非常感谢您的回复。
  • 你好@Brendan,我终于得到了我的问题的答案。非常感谢您的建议和回复。 :)

标签: graph acumatica dac


【解决方案1】:

我通过在我的 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

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

【讨论】:

  • 要使用 PXDBDefault,您确实需要 PXParent,因此它知道如何与默认值所需的值相关联。您只需要在任何一个字段上使用 PXParent(我通常附加到第一个关键字段),然后您就可以在任意数量的字段上使用 PXDBDefault。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多