Hi Team,
Need to know how to save only selected rows records only. Can someone help me out?
Thanks
Best answer by jinin
View originalHi Team,
Need to know how to save only selected rows records only. Can someone help me out?
Thanks
Best answer by jinin
View originalHi,
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
[PXOverride]
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
[PXOverride]
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.