我需要重写用于SOShipmentPlan
PXProjection / DAC的Select语句,即删除该
And <INPlanType.isFixed, Equal<boolFalse>
条件。
我可以重写所有CreateShipment()
逻辑,并将任何其他必要的例程引入SOShipmentEntry_Extension
类,以至于最终我可以使用自己的SOShipmentPlan
类版本,但是所有这些看起来都不必要地复杂当我要做的是覆盖对PXProjection属性的选择时。覆盖CreateShipment()
和支持例程似乎也是麻烦升级的一种快速方法。
所以,有一种简单的方法可以覆盖PXProjection
的BQL,还是我被困重写了所有代码?
UPDATE 1
基于下面提供的链接,我觉得我已经接近了。这是我最终得到的代码块:
[Serializable]
[PXProjection(typeof(Select2<SOOrder,
InnerJoin<SOOrderType, On<SOOrder.FK.OrderType>,
InnerJoin<INItemPlan, On<INItemPlan.refNoteID, Equal<SOOrder.noteID>>,
InnerJoin<INPlanType, On<INItemPlan.FK.PlanType>>>>,
Where<INItemPlan.hold, Equal<boolFalse>,
And<INItemPlan.planQty, Greater<decimal0>,
And<INPlanType.isDemand, Equal<boolTrue>,
And<INPlanType.isForDate, Equal<boolTrue>,
And<Where<INItemPlan.fixedSource, IsNull, Or<INItemPlan.fixedSource, NotEqual<INReplenishmentSource.transfer>>>>>>>>>))]
[PXSubstitute()]
public partial class SOShipmentPlanCst : SOShipmentPlan
{
}
但是它似乎不起作用。不知道我应该把代码放在哪里。我试过将类定义放在public class SOShipmentEntry_Extension : PXGraphExtension<SOShipmentEntry>
类的内部和外部。无论哪种方式都没有运气。
一般警告...我之前尚未对PXProjection执行此操作,因此您必须查看其是否有效。扩展的性质倾向于通过简单地重新定义views来覆盖它们。我本人并没有进行投影,但是我怀疑它会类似。尝试一下,看看您是否获得了预期的结果。关于测试,我只能说的是,当我添加到项目中并删除了INItemPLanType.isFixed条件时,它已“编译”。
public class SOShipmentEntry_Extension : PXGraphExtension<SOShipmentEntry>
{
[PXProjection(typeof(Select2<SOOrder,
InnerJoin<SOOrderType, On<SOOrder.FK.OrderType>,
InnerJoin<INItemPlan, On<INItemPlan.refNoteID, Equal<SOOrder.noteID>>,
InnerJoin<INPlanType, On<INItemPlan.FK.PlanType>>>>,
Where<INItemPlan.hold, Equal<boolFalse>,
And<INItemPlan.planQty, Greater<decimal0>,
And<INPlanType.isDemand, Equal<boolTrue>,
And<INPlanType.isForDate, Equal<boolTrue>,
And<Where<INItemPlan.fixedSource, IsNull, Or<INItemPlan.fixedSource, NotEqual<INReplenishmentSource.transfer>>>>>>>>>))]
public partial class SOShipmentPlan : IBqlTable { }
}