Reputation: 479
I need to add a new filter on Write Off Balances and Credits(AR505000). Normally you have to copy the PXFilteredProcessingJoin or PXProcessingJoin field to the extension class and the IEnumerable function that comes with it. But in the Write Off Balances and Credits pages there is no IEnumerable. How would one approach adding more filters?
I was thinking of adding the IEnumerable my self:
public class ARCreateWriteOff_Extension : PXGraphExtension<ARCreateWriteOff>
{
#region Event Handlers
//THis is copied form the Graph
[PXFilterable]
// [PX.SM.PXViewDetailsButton(typeof(ARRegisterEx.refNbr), WindowMode = PXRedirectHelper.WindowMode.NewWindow)]
public PXFilteredProcessingJoin<ARRegisterEx, ARWriteOffFilter,
InnerJoin<Customer,
On<Customer.bAccountID, Equal<ARRegisterEx.customerID>,
And<Customer.smallBalanceAllow, Equal<True>>>,
LeftJoin<ARAdjust,
On<ARAdjust.adjdDocType, Equal<ARRegisterEx.docType>,
And<ARAdjust.adjdRefNbr, Equal<ARRegisterEx.refNbr>,
And<ARAdjust.released, Equal<False>,
And<ARAdjust.voided, Equal<False>>>>>,
LeftJoin<ARAdjust2,
On<ARAdjust2.adjgDocType, Equal<ARRegisterEx.docType>,
And<ARAdjust2.adjgRefNbr, Equal<ARRegisterEx.refNbr>,
And<ARAdjust2.released, Equal<False>,
And<ARAdjust2.voided, Equal<False>>>>>>>>,
Where<
Where2< MatchWithBranch<ARRegisterEx.branchID>,
And2<Match<Current<AccessInfo.userName>>,
And<ARRegisterEx.released, Equal<True>,
And<ARRegisterEx.hold, NotEqual<True>,
And<ARRegisterEx.openDoc, Equal<True>,
And<ARRegisterEx.pendingPPD, NotEqual<True>,
And2<
Where< ARRegisterEx.docBal, Greater<decimal0>,
Or<ARRegisterEx.curyDocBal, Greater<decimal0>>>,
And<ARRegisterEx.docBal, LessEqual<Current<ARWriteOffFilter.wOLimit>>,
And2< Where< Current2<ARWriteOffFilter.branchID>, IsNull,
Or<ARRegisterEx.branchID, Equal<Current<ARWriteOffFilter.branchID>>>>,
And2< Where<Current<ARWriteOffFilter.woType>, Equal<ARDocType.smallBalanceWO>,
And2< Where< ARRegisterEx.docType, Equal<ARDocType.invoice>,
Or<ARRegisterEx.docType, Equal<ARDocType.debitMemo>,
Or<ARRegisterEx.docType, Equal<ARDocType.finCharge>>>>,
And< ARAdjust.adjgRefNbr, IsNull,
Or<Current<ARWriteOffFilter.woType>, Equal<ARDocType.smallCreditWO>,
And2< Where< ARRegisterEx.docType, Equal<ARDocType.payment>,
Or<ARRegisterEx.docType, Equal<ARDocType.creditMemo>,
Or<ARRegisterEx.docType, Equal<ARDocType.prepayment>>>>,
And<ARAdjust2.adjdRefNbr, IsNull>>>>>>,
And<Where< Current<ARWriteOffFilter.customerID>, IsNull,
Or<Current<ARWriteOffFilter.customerID>, Equal<ARRegisterEx.customerID>>>>>>>>>>>>>>>>
ARDocumentList;
protected virtual IEnumerable aRDocumentList()
{
ARWriteOffFilter aRWriteOffFilter = Base.Filter.Current;
ARWriteOffFilterExt aRWriteOffFilterExt = aRWriteOffFilter.GetExtension<ARWriteOffFilterExt>();
foreach (ARRegisterEx item in ARDocumentList.Select())
{
if (1==1)//removed my customer filter to removed cluter
{
yield return item;
}
else
{
yield return item;
}
}
}
#endregion
}
}
Upvotes: 0
Views: 126
Reputation: 309
To modify a data view, you have to redefine the data view in the graph extension class. The data view redefined within a BLC extension completely replaces the base data view within the Views collection of a graph instance, including all attributes attached to the data view declared within the base graph. You can either attach the same set of attributes to the data view or completely redeclare the attributes. The data view must have exactly the same identifier (the same name), which is referred to in the appropriate container in the ASPX page.
Or, you can change the existing data view, by adding new filters/joins in the graph constructor (in extension you do that by overriding Initialize
in the graph extension)
public override void Initialize()
{
base.Initialize();
this.Base.ARDocumentList.WhereNew< your new Where filter here >();
//or WhereAnd< ... >(); to append contitions to existing one
//you can also add this.Base.ARDocumentList.Join< _join a new table here >();
}
Upvotes: 1