Skip to main content
Solved

Refresh the Filter values after save or add new record.


Forum|alt.badge.img

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

Best answer by vardan22

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

 

View original
Did this topic help you find an answer to your question?

5 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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,


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 51 replies
  • November 7, 2023
Vignesh Ponnusamy wrote:

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();
        }


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 669 replies
  • November 7, 2023

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?


vardan22
Jr Varsity III
Forum|alt.badge.img+1
  • Jr Varsity III
  • 44 replies
  • Answer
  • November 8, 2023

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

 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 51 replies
  • November 8, 2023
vardan22 wrote:

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. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings