Solved

Grid data refresh & reload issue with updated data view

  • 9 February 2022
  • 2 replies
  • 954 views

Userlevel 2
Badge

Hi Everyone

  I am facing one problem, After update the data view Records in RowSelected event, in that data view new records affected. But, in grid displaying old values.

Can you help me please…?

In the bellow am adding my graph functionality.

In This Grid Showing only Opportunity Records.

 

Data View:-

 public SelectFrom<SSPAgreement>.OrderBy<SSPAgreement.active.Desc, SSPAgreement.agreeDate.Asc,

           SSPAgreement.agreeNbr.Asc>.View Agreements;

Event Handler:-

 

 protected virtual void CROpportunity_RowSelected(PXCache sender, PXRowSelectedEventArgs e)

        {

            CROpportunity row = (CROpportunity)e.Row;

            if (row == null) return;

            var sPSetup = AutoNumSetup.Current;

            Agreements.Cache.AllowSelect = sPSetup.EnableOpp == true;


            Agreements.View.Cache.Clear();

            Agreements.View.Cache.ClearQueryCache();

            var AgreementList = PXSelect<SSPAgreement,

       Where<SSPAgreement.agreeType, In<Required<SSPAgreement.agreeType>>>>.

       Select(Base, "Opp");

            if (AgreementList != null)

            {

                foreach (SSPAgreement item in AgreementList)

                {

                    SSPAgreement Agreement = new SSPAgreement();

                    Agreement.AgreeNbr = item.AgreeNbr;

                    Agreement.AgreeType = item.AgreeType;

                    Agreement.AgreeDate = item.AgreeDate;

                    Agreement.Descr = item.Descr;

                    Agreement.Revision = item.Revision;

                    Agreement.Active = item.Active;

                    Agreement.TemplateCode = item.TemplateCode;

      

                    Agreements.Cache.Update(Agreement);

                }

            }

            Agreements.View.RequestRefresh();

        }

 

 

 

icon

Best answer by Naveen Boga 9 February 2022, 17:41

View original

2 replies

Userlevel 7
Badge +17

Hi, @NageswaraRaoAddanki60  It is NOT recommended to update the records in the Row_Selected event.

You can move this logic to your viewDelegate/ respective proper event and verify.

Userlevel 2
Badge

Hi, @NageswaraRaoAddanki60  It is NOT recommended to update the records in the Row_Selected event.

You can move this logic to your view Delegate/ respective proper event and verify.

 Okay @Naveen B 
Thank you for your support & Advise.

 

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