Skip to main content
Question

Loop the PXGrid and change rows values by custom PXAction button

  • October 6, 2023
  • 4 replies
  • 56 views

Forum|alt.badge.img

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

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • October 6, 2023

Hi @bhagyat25 ,

Can you please give some more details about your requirements?


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • October 6, 2023

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


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • October 6, 2023

Hi @bhagyat25 ,

Try like below,

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

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

 


palbores
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • October 10, 2023

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