Question

Loop the PXGrid and change rows values by custom PXAction button

  • 6 October 2023
  • 4 replies
  • 42 views

Userlevel 3
Badge

Hi, Need to know how to loop the PXGrid and change rows values by custom PXAction button.

Can someone help me out?

Thanks


4 replies

Userlevel 7
Badge +11

Hi @bhagyat25 ,

Can you please give some more details about your requirements?

Userlevel 3
Badge

Hi @jinin ,

This is my screen and I need to loop the grid row and update it’s values after calling an API.

My graph view is this  “public SelectFrom<HMRCVendorRegisterDetail>.View VendorRegisterDetail; “

and also need to loop only selected records. (usrSelect is the name of the Select field).

 

 

Thanks

Userlevel 7
Badge +11

Hi @bhagyat25 ,

Try like below,

 foreach (HMRCVendorRegisterDetail objlineItems in VendorRegisterDetail.Select())
                    {

                        objlineItems.Active = false;
                        //Add other fields
                        VendorRegisterDetail.Update(objlineItems);
                    }
                    graphname.PressSave();

 

Userlevel 3
Badge

Hi @bhagyat25 you can try this code below if this is what you meant for.

foreach (HMRCVendorRegisterDetail line in VendorRegisterDetail.Select())
{
if (line?.usrSelect ?? false)
{
//add fields to update here
VendorRegisterDetail.Update(line);
}
Save.Press();
}

 

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