尊敬的先生/女士,
请问我是否曾经在社区中提出过这个问题,但是我似乎无法找到解决我问题的正确答案。
我有一个扩展的图,其中包含2个自定义视图,即 ReservationDetails和PropertyItems 。
GRAPH
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日
我也尝试替换页面上的库存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
答案 0 :(得分:0)
我通过在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
非常感谢您提供的所有帮助。编码愉快! :)