Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created March 14, 2017 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarenich/5dd521a9a854ec964272debabcaf5990 to your computer and use it in GitHub Desktop.
Save smarenich/5dd521a9a854ec964272debabcaf5990 to your computer and use it in GitHub Desktop.
PXReportRequiredException ex = null;
if(row.ARRefNumber != null)
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary["DocType"] = row.ARDocType;
dictionary["RefNbr"] = row.ARRefNumber;
ex = PXReportRequiredException.CombineReport(ex, row.ARBatchNumber == null ? "AR610500" : "AR622000", dictionary, false);
}
if (row.APRefNumber != null)
{
APInvoice inv = PXSelectorAttribute.Select<DocHeader.aPRefNumber>(Document.Cache, row) as APInvoice;
Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary["DocType"] = row.APDocType;
dictionary["RefNbr"] = row.APRefNumber;
dictionary["PeriodTo"] = PX.Objects.GL.OpenPeriodAttribute.FormatForDisplay(inv.FinPeriodID);
dictionary["PeriodFrom"] = PX.Objects.GL.OpenPeriodAttribute.FormatForDisplay(inv.FinPeriodID);
ex = PXReportRequiredException.CombineReport(ex, row.APBatchNumber == null ? "AP610500" : "AP622000", dictionary, false);
}
if (ex != null)
{
ex.Mode = PXBaseRedirectException.WindowMode.New;
ex.SeparateWindows = true;
throw ex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment