Hi Team,
Need to know how to save only selected rows records only. Can someone help me out?
Â
Thanks
Â
Hi Team,
Need to know how to save only selected rows records only. Can someone help me out?
Â
Thanks
Â
Hi,
Â
I would suggest,
Override the RowPersisting event for the lines, in there check to see if the Select box is ticked, if so call the base row persisting method, if not do nothing.
I’m not 100% sure if the do nothing piece will be sufficient to stop the save on the unselected lines. You might need to do something to remove the lines you don’t want to save from the cache (within the row persisting event) or raise some kind of event.
Â
Maybe have a go and share you code if your not getting the outcome you want?
Â
JOhn
Â
Â
HiÂ
AsÂ
 protected virtual void PrimaryDAC_RowPersisting(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
    {
      if (e.Row == null) return;
      foreach (DACName obj in ViewName.Select())
      {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
    }
Â
HiÂ
AsÂ
 protected virtual void PrimaryDAC_RowPersisting(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
    {
      if (e.Row == null) return;
      foreach (DACName obj in ViewName.Select())
      {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
    }
Â
Hi
I tried your code but it is not working as I expected. record is moving to the deleted cache from the updated cache list. But still it is updating.Â
Hi
Did u try the same logic with Persist override?
 ÂPXOverride]
 public void Persist(Action del)
 {
   foreach (DACName obj in ViewName.Select())
     {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
      del();
    }
HiÂ
Did u try the same logic with Persist override?
 PXOverride]
 public void Persist(Action del)
 {
   foreach (DACName obj in ViewName.Select())
     {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
      del();
    }
Hi
How to call this method? Can you please tell me how to call this method in the graph?
HiÂ
Did u try the same logic with Persist override?
 PXOverride]
 public void Persist(Action del)
 {
   foreach (DACName obj in ViewName.Select())
     {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
      del();
    }
HiÂ
How to call this method? Can you please tell me how to call this method in the graph?
HiÂ
This is the Save action override method. you can use the same code. and write logic inside..
HiÂ
Did u try the same logic with Persist override?
 PXOverride]
 public void Persist(Action del)
 {
   foreach (DACName obj in ViewName.Select())
     {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
      del();
    }
HiÂ
How to call this method? Can you please tell me how to call this method in the graph?
HiÂ
This is the Save action override method. you can use the same code. and write logic inside..
Hi
    ePXOverride]
    public void PersistMethod(Action del, PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
    {
      foreach (HMRCVendorRegisterDetail obj in VendorRegisterDetail.Select())
      {
        if (obj.UsrSelect == false)
        {
          VendorRegisterDetail.Delete(obj);
        }
      }
      del();
    }
HiÂ
Did u try the same logic with Persist override?
 PXOverride]
 public void Persist(Action del)
 {
   foreach (DACName obj in ViewName.Select())
     {
        if(obj.Selected==false)
        {
          View.Delete(obj);
        }
      }
      del();
    }
HiÂ
How to call this method? Can you please tell me how to call this method in the graph?
HiÂ
This is the Save action override method. you can use the same code. and write logic inside..
HiÂ
    ePXOverride]
    public void PersistMethod(Action del, PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
    {
      foreach (HMRCVendorRegisterDetail obj in VendorRegisterDetail.Select())
      {
        if (obj.UsrSelect == false)
        {
          VendorRegisterDetail.Delete(obj);
        }
      }
      del();
    }
Â
public void PersistMethod(Action del, PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseEvent)
This is wrong
You should use like below(Check my sample above)
public void Persist(Action del)Â {
Â
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.