public SelectFrom<CustomTable01>.View FilterView;
public PXFilter<CustomFilte> Filter;
public virtual IEnumerable deleteLine(PXAdapter adapter)
{
/// Code to retrieve the PXResultset
foreach (var CustomTable01Row in CustomTable01Rows)
{
Method 1 --------- this.FilterView.Delete(CustomTable01Row);
Method 2 --------- this.FilterView.Cache.Delete(CustomTable01Row);
Method 3 --------- this.FilterView.Delete(CustomTable01Row);
this.Persist();
Method 4 --------- this.FilterView.Cache.Delete(CustomTable01Row);
this.Actions.PressSave();
}
}
I created a custom screen with a filter with a results grid. When a user selects a line and presses an action button, I want to delete the selected row from the database. I retrieved the relevant row in the data access component (DAC) and attempted four different deletion methods. Methods 1 and 2 resulted in the row being deleted only from the user interface (UI). Upon screen refresh, the row reappeared. Methods 3 and 4 produced the following error. How can I fix this and delete the selected line form the database? Any detailed instructions, tips, or code snippets would be greatly appreciated. Thank you!
PX.Data.PXLockViolationException
Error: Another process has deleted the 'PTProductionPlanOrderHeaderTable' record. Your changes will be lost.