public static void ReleaseBatch(List <GLVoucherBatch> list) { GLVoucherBatchMaint pg = PXGraph.CreateInstance <GLVoucherBatchMaint>(); Dictionary <string, Dictionary <Guid, CAMessage> > errorLog = new Dictionary <string, Dictionary <Guid, CAMessage> >(); List <int> failed = new List <int>(); PXLongOperation.SetCustomInfo(errorLog); int failedCount = 0; for (int i = 0; i < list.Count; i++) { pg.Clear(PXClearOption.PreserveData); GLVoucherBatch batch = list[i]; try { pg.ReleaseBatchProc(batch, errorLog); } catch (Exception) { failedCount++; } } if (failedCount > 0) { throw new PXException(Messages.BatchReleaseFiled); } }
public static void DeleteBatch(GLVoucherBatch batch, object[] processingList) { GLVoucherBatchMaint pg = PXGraph.CreateInstance <GLVoucherBatchMaint>(); Dictionary <string, Dictionary <Guid, CAMessage> > errorLog = new Dictionary <string, Dictionary <Guid, CAMessage> >(); PXLongOperation.SetCustomInfo(errorLog, processingList); pg.Clear(PXClearOption.PreserveData); pg.DeleteBatchProc(batch, errorLog); }