Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public PXAction<MultiPayment> Release;
[PXProcessButton]
[PXUIField(DisplayName = "Release")]
protected virtual void release()
{
this.Actions.PressSave();
PXLongOperation.StartOperation(this, delegate ()
{
CreatePayment(row);
});
}
public static void CreatePayment(MultiPayment multi)
{
ReleaseInfo info = new ReleaseInfo();
//....
try
{
//Do all processing
}
catch(Exception ex)
{
info.details[line.Key] = ex;
}
//....
PXLongOperation.SetCustomInfo(info);
}
public class ReleaseInfo : IPXCustomInfo
{
public Dictionary<string, Exception> details = new Dictionary<string, Exception>();
public void Complete(PXLongRunStatus status, PXGraph graph)
{
if (status == PXLongRunStatus.Aborted && graph is MultiPaymentEntry)
{
((MultiPaymentEntry)graph).RowSelected.AddHandler<MultiPaymentLine>((sender, e) =>
{
MultiPaymentLine line = e.Row as MultiPaymentLine;
if (line != null)
{
if (details.ContainsKey(line.Key))
{
Exception ex = details[line.Key];
if (ex != null) sender.RaiseExceptionHandling<MultiPaymentLine.key>(line, line.Key,
new PXSetPropertyException(ex.Message, PXErrorLevel.RowError));
}
}
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.