Skip to main content
Answer

Automatically refresh the Screen/Grid after processed the records in Processing screen

  • November 27, 2021
  • 7 replies
  • 1397 views

Forum|alt.badge.img+1

Hi,
I created one Processing screen with List of Vendors..
After Processed selected records(3), All records(10) got vanished from the screen.
If I refresh the grid/screen, then unprocessed records(7) are showing in the screen.
How can I get unprocessed records automatically  without refresh after processing??
Thanks.

Best answer by Naveen Boga

Hi @girik06  Can you please below code and check once?

  public PXCancel<Vendor> Cancel;

 

Code: 

public class VendorProcess : PXGraph<VendorProcess>
{

public PXCancel<Vendor> Cancel;
public PXProcessing<Vendor, Where<VendorExt.usrExpiryDt,
Less<Current<AccessInfo.businessDate>>>> VendorProcess;



public VendorProcess()
{
VendorProcess.SetProcessDelegate(delegate (List<Vendor> list)
{
VendorProcess(list);
});

}

public static void VendorProcess(List<Vendor> listvalrow)
{
VendorMaint vegraph = PXGraph.CreateInstance<VendorMaint>();
foreach (Vendor ven in listvalrow)
{
PXUpdate<Set<VendorExt.usrStatus, Required<VendorExt.usrStatus>>, Vendor,
Where<Vendor.bAccountID,
Equal<Required<Vendor.bAccountID>>>>.Update(vegraph, "RV", ven.BAccountID);

vegraph.Persist();

}
VendorProcess grp = PXGraph.CreateInstance<VendorProcess>();
grp.VendorProcess.Cache.Clear();
grp.VendorProcess.View.RequestRefresh();
}
}

 

 

 

 

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • November 27, 2021

Hi @girik06  Actually it should not vanish the records after processing, can you please share the processing screen code here?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • November 27, 2021

Hi @girik06  Actually it should not vanish the records after processing, can you please share the processing screen code here?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • November 27, 2021

Hi @girik06   Actually, it should not vanish the records after processing, can you please share the processing screen code here?


Forum|alt.badge.img+1
  • Author
  • Pro I
  • November 27, 2021

Hi @Naveen B  below is the Code:
 


 public class VendorProcess : PXGraph<VendorProcess>
    {
   
  public PXProcessing<Vendor, Where<VendorExt.usrExpiryDt,
            Less<Current<AccessInfo.businessDate>>>> VendorProcess;
        public VendorProcess()
        {
            VendorProcess.SetProcessDelegate(delegate (List<Vendor> list)
            {
                VendorProcess(list);
            });
            
        }

        public static void VendorProcess(List<Vendor> listvalrow)
        {
            VendorMaint vegraph = PXGraph.CreateInstance<VendorMaint>();
            foreach (Vendor ven in listvalrow)
            {
                PXUpdate<Set<VendorExt.usrStatus, Required<VendorExt.usrStatus>>, Vendor,
                           Where<Vendor.bAccountID,
                           Equal<Required<Vendor.bAccountID>>>>.Update(vegraph, "RV", ven.BAccountID);

                  vegraph.Persist();

            }
            VendorProcess grp = PXGraph.CreateInstance<VendorProcess>();
            grp.VendorProcess.Cache.Clear();
            grp.VendorProcess.View.RequestRefresh();
         }
}


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • November 27, 2021

Hi @girik06  Can you please below code and check once?

  public PXCancel<Vendor> Cancel;

 

Code: 

public class VendorProcess : PXGraph<VendorProcess>
{

public PXCancel<Vendor> Cancel;
public PXProcessing<Vendor, Where<VendorExt.usrExpiryDt,
Less<Current<AccessInfo.businessDate>>>> VendorProcess;



public VendorProcess()
{
VendorProcess.SetProcessDelegate(delegate (List<Vendor> list)
{
VendorProcess(list);
});

}

public static void VendorProcess(List<Vendor> listvalrow)
{
VendorMaint vegraph = PXGraph.CreateInstance<VendorMaint>();
foreach (Vendor ven in listvalrow)
{
PXUpdate<Set<VendorExt.usrStatus, Required<VendorExt.usrStatus>>, Vendor,
Where<Vendor.bAccountID,
Equal<Required<Vendor.bAccountID>>>>.Update(vegraph, "RV", ven.BAccountID);

vegraph.Persist();

}
VendorProcess grp = PXGraph.CreateInstance<VendorProcess>();
grp.VendorProcess.Cache.Clear();
grp.VendorProcess.View.RequestRefresh();
}
}

 

 

 

 


Forum|alt.badge.img+1
  • Author
  • Pro I
  • November 27, 2021

Thank you Naveen. It works.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • November 27, 2021

@girik06  Great :) Thanks for sharing the update