Skip to main content

Dear Team,

 I have created duplicate Screen and use the same graph and DAC, I want show show only related screen records when i click toolbar attached image below.

 

When navigate through toolbar it shows both screen records. how to filter record here. I have filter separate GI & Selector 

Thanks,

Arun.

Hi @arun83 

Can you try to give Where Condition (CreatedByScreenID=YourScreenID) for RefNbr Selector.

Thanks.


Hi @arun83 

Can you try to give Where Condition (CreatedByScreenID=YourScreenID) for RefNbr Selector.

Thanks.

Its not working with different scenario. 


@arun83  Have you tried loading the Documents in the REF NBR. field by adding a ScreenID condition by writing the Cache_Attached Event?

if yes, can you please share it here, so that we can review it and suggest if any code modifications are required?


Would a PXRestrictor work on the selector? It may have the same drawbacks as filtering the Selector. Maybe it would be helpful to know what situation that is a problem for.


Yes, It should work with Cache_Attached with PXRestrictor.

 


My scenario is i have 3 duplicate screen for different purpose & also i have Boolean flag to differentiate record from each screen and filter GI.  but when it comes to RefNbr i can filter also but when i navigate record using toolbar it shows other screen records also. 


my navigation still not working. It filters only selector. Tollbar still showing other module record 

 

  PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
  >PXDefault()]
  /PXUIField(DisplayName = "Reference Nbr.", Visibility = PXUIVisibility.SelectorVisible, TabOrder = 1)]
  APInvoiceType.RefNbr(typeof(Search2<Standalone.APRegisterAlias.refNbr,
  InnerJoinSingleTable<APInvoice, On<APInvoice.docType, Equal<Standalone.APRegisterAlias.docType>,
  And<APInvoice.refNbr, Equal<Standalone.APRegisterAlias.refNbr>>>,
  InnerJoinSingleTable<Vendor, On<Standalone.APRegisterAlias.vendorID, Equal<Vendor.bAccountID>>>>,
  Where<Standalone.APRegisterAlias.docType, Equal<Optional<APInvoice.docType>>,
  And2<Where<Standalone.APRegisterAlias.origModule, NotEqual<BatchModule.moduleTX>,
  Or<Standalone.APRegisterAlias.released, Equal<True>>>,
  And<Match<Vendor, Current<AccessInfo.userName>>>>>,
  OrderBy<Desc<Standalone.APRegisterAlias.refNbr>>>), Filterable = true, IsPrimaryViewCompatible = true)]
  tAPInvoiceType.Numbering()]
  rPXFieldDescription]
  rPXRestrictor(typeof(Where<APRegisterExt.usrRental, Equal<Current<APRegisterExt.usrRental>>>), "Show record by rental flag")]
  protected virtual void APInvoice_RefNbr_CacheAttached(PXCache cache)
  {

  }
 


You have to change the PXView for the header part of Requisitions screen. To do that you need to override the Initialize() method in the your graph extsnsion created from RQRequisitionEntry graph.
Below example will display records only if priority is Normal(this is additional condition added into the base PXSelect for header part).

public class RQRequisitionEntry_Extension : PXGraphExtension<RQRequisitionEntry>
{
public override void Initialize()
{
base.Initialize();
var command = new PXSelectJoin<
RQRequisition,
LeftJoinSingleTable<Customer,
On<Customer.bAccountID, Equal<RQRequisition.customerID>>,
LeftJoinSingleTable<Vendor,
On<Vendor.bAccountID, Equal<RQRequisition.vendorID>>>>,
Where2<
Where<Customer.bAccountID, IsNull,
Or<Match<Customer, Current<AccessInfo.userName>>>>,
And2<Where<Vendor.bAccountID, IsNull,
Or<Match<Vendor, Current<AccessInfo.userName>>>>,
And<RQRequisition.priority, Equal<int1>>>>>(this.Base);
Base.Views["Document"] = new PXView(Base, false, command.View.BqlSelect);
}
}

 


@vardan22 - What’s the difference (pros / cons) between altering the view 👆🏼 and redefining it? 


@vardan22 - What’s the difference (pros / cons) between altering the view 👆🏼 and redefining it? 

@darylbowman -  good question.  I'm pretty sure one of the first problems could be not correct current and cached records.
I've never checked, but here is my thoughts:

if redefining is mean to create a new PXSelect with the same name of view in the extension graph , I guess it will work(for small customizations) but it can cause problem when the same graph has more then one or two graph extension(because each of extensions will use view from the base graph). I'm pretty sure during the time it will have problem with current and cached records.

if redefining is mean to create an method with view name that will return IEnumerable that I can say this will not work for  header part of entry type of graphs.


It seems like your code is altering the view in a graph extension as well though. Are you saying that this change will be maintained across multiple graph extensions? Or would you need to redefine in each graph extension?


It seems like your code is altering the view in a graph extension as well though. Are you saying that this change will be maintained across multiple graph extensions? Or would you need to redefine in each graph extension?

it changed the view from the base graph views collection ”Base.Views”, so I think it make sense to work for each extension, but I never checked it, so this is just my logical conclusion.


Ah, got it.


You have to change the PXView for the header part of Requisitions screen. To do that you need to override the Initialize() method in the your graph extsnsion created from RQRequisitionEntry graph.
Below example will display records only if priority is Normal(this is additional condition added into the base PXSelect for header part).

public class RQRequisitionEntry_Extension : PXGraphExtension<RQRequisitionEntry>
{
public override void Initialize()
{
base.Initialize();
var command = new PXSelectJoin<
RQRequisition,
LeftJoinSingleTable<Customer,
On<Customer.bAccountID, Equal<RQRequisition.customerID>>,
LeftJoinSingleTable<Vendor,
On<Vendor.bAccountID, Equal<RQRequisition.vendorID>>>>,
Where2<
Where<Customer.bAccountID, IsNull,
Or<Match<Customer, Current<AccessInfo.userName>>>>,
And2<Where<Vendor.bAccountID, IsNull,
Or<Match<Vendor, Current<AccessInfo.userName>>>>,
And<RQRequisition.priority, Equal<int1>>>>>(this.Base);
Base.Views["Document"] = new PXView(Base, false, command.View.BqlSelect);
}
}

 

I tested this code work as expected, 

Thanks,

Arun.


Reply