Solved

Refresh the Filter values after save or add new record.

  • 7 November 2023
  • 5 replies
  • 85 views

Userlevel 3
Badge

Hi Team,

In my screen there is a PXSelector control, Once I fill the relevant information and press the Save button or after save Press the Add new record button, that PXSelector values are not refresh. It only changes after manually refresh the web page by browser refresh button.

Can someone help me out?

UI

DAC Field

 [PXUIField(DisplayName = "Vendor", Required = true)]
[PXDBInt]        
[PXSelector(typeof(Search2<BAccount.bAccountID, LeftJoin<HMRCVendorRegisterDetail, On<BAccount.bAccountID, 
Equal<HMRCVendorRegisterDetail.bAccountID>>>, Where<BAccount.type, Equal<BAccountType.vendorType>,And <HMRCVendorRegisterDetail.bAccountID, IsNull>>
>),
typeof(BAccount.acctCD),
typeof(BAccount.acctName),
SubstituteKey = typeof(BAccount.acctCD),
DescriptionField = typeof(BAccount.acctName))]
[PXCheckUnique(typeof(HMRCVendorRegisterDetail.bAccountID))]
[PXDBDefault(PersistingCheck =PXPersistingCheck.NullOrBlank)]
public virtual int? BAccountID { get; set; }
public abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }

Also tried this too in the graph

protected void _(Events.RowPersisted<HMRCVendorRegisterDetail> e)
        {
            VendorRegisterDetail.Cache.Clear();
            VendorRegisterDetail.View.RequestFiltersReset();
        }

Thanks

icon

Best answer by vardan22 8 November 2023, 10:30

View original

5 replies

Userlevel 7
Badge +4

Hi @bhagyat25,

You try this.viewName.RequestRefresh() or Base.viewName.RequestRefresh() in the RowSelected or RowUpdated event handler.

For more details on it refer, https://help.acumatica.com/(W(13))/Help?ScreenId=ShowWiki&pageid=ab0b17cd-aa50-379c-398a-db87293d4aa7

Thanks,

Userlevel 3
Badge

Hi @bhagyat25,

You try this.viewName.RequestRefresh() or Base.viewName.RequestRefresh() in the RowSelected or RowUpdated event handler.

For more details on it refer, https://help.acumatica.com/(W(13))/Help?ScreenId=ShowWiki&pageid=ab0b17cd-aa50-379c-398a-db87293d4aa7

Thanks,

Hi @Vignesh Ponnusamy ,

I tried your code. But still no luck until I press the refresh button of the browser PXSelector not refreshed.

protected void _(Events.RowUpdated<HMRCVendorRegisterDetail> e)
        {
            //VendorRegisterDetail.Cache.Clear();
            VendorRegisterDetail.View.RequestRefresh();
        }

Userlevel 7
Badge +11

Hi @bhagyat25 ,

As per the Acumatica framework, by default, adding new records clears the values from the form. There is no need to forcefully clear or refresh the form.

Can you please cross-check if you have added the key constraints and created the table, DAC, and Graph properly?

Userlevel 4
Badge +1

As I understand your problem related to refreshing the lookup view for PXSelector attribute.
In that case you just need to set to ‘True’ the AutoRefresh property for the PXSelector control from the customization editor

 

Userlevel 3
Badge

As I understand your problem related to refreshing the lookup view for PXSelector attribute.
In that case you just need to set to ‘True’ the AutoRefresh property for the PXSelector control from the customization editor

 

Thanks @vardan22, You saved me. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved