Inserting 'GL Batch' record raised at least one error. Please review the errors. The 20-2512 financial period does not exist for the PRODUCTS company.
JournalEntry journalEntry = PXGraph.CreateInstance<JournalEntry>();
PostGraph pg = PXGraph.CreateInstance<PostGraph>();
journalEntry.ReverseBatchProc(batch);
journalEntry.BatchModule.SetValueExt<Batch.module>(journalEntry.BatchModule.Current, batch.Module);
journalEntry.BatchModule.SetValueExt<Batch.dateEntered>(journalEntry.BatchModule.Current, tranDate);
journalEntry.BatchModule.SetValueExt<Batch.finPeriodID>(journalEntry.BatchModule.Current, finPeriodID);
PXCache gltrans = journalEntry.Caches[typeof(GLTran)];
foreach (object gltr in gltrans.Inserted)
{
gltrans.SetValueExt<GLTran.module>(gltr, batch.Module);
gltrans.SetValueExt<GLTran.tranDate>(gltr, tranDate);
gltrans.SetValueExt<GLTran.finPeriodID>(gltr, finPeriodID);
}
if (journalEntry.BatchModule.Current.Status == BatchStatus.Hold)
{
journalEntry.BatchModule.Current.Approved = true;
journalEntry.releaseFromHold.Press();
}
journalEntry.Save.Press();
