I have scheduled a ProcessAll action. I have a
throw new PXOperationCompletedException(statusText);
at the end of the routine if there are no
The PXProcessing class contains the following static methods:
.
public static void ProcessDelegate(List dacRecords)
{
int rowIndex = 0;
bool isError = false;
foreach (DAC dacRecord in dacRecords)
{
PXProcessing.SetCurrentItem(dacRecord);
try
{
// Set Error Message
PXProcessing.SetError(rowIndex, new PXException("Error Message"));
// Set Warning Message
PXProcessing.SetWarning(rowIndex, new PXException("Warning Message"));
// Set Info Message (green check mark)
PXProcessing.SetInfo(rowIndex, "The record has been processed successfully.");
}
catch (Exception ex)
{
PXProcessing.SetError(rowIndex, new PXException(ex.ToString()));
isError = true;
}
rowIndex++;
}
if (isError)
{
throw new PXOperationCompletedWithErrorException();
}
else
{
PXProcessing.SetProcessed()
}
}