Hi All,
I have a batch for importing and posting packing slip for PO and sometimes while doing so we are getting some set up error while doing packing slip like fiscal calendar not defined etc...
so I need to capture the error in exception log and same time need to show the error as it is while running the batch job manually
private str getErrorStr()
{
SysInfologEnumerator enumerator;
SysInfologMessageStruct msgStruct;
Exception exception;
str error;
enumerator = SysInfologEnumerator::newData(infolog.cut());
while (enumerator.moveNext())
{
msgStruct = new SysInfologMessageStruct(enumerator.currentMessage());
exception = enumerator.currentException();
error = msgStruct.message();
this.method2(error);
}
return error;
}
and
private void method2(String255 _message)
{
if(!exceptionID)
{
this.CreateExceptionRecord(_message);
}
else
{
this.createExceptionLines(_message, IntegrationExceptionLog.ExceptionId);
}
}
and in the main logic class where i am doing packing slip i am calling the below code
try
{
this.PartialPOPartialPacking(purchTablePartner);
}
catch(Exception::Error)
{
info("@SON2022");
this.getErrorStr();
}
the problem is when i capture the exception by SysInfologMessageStruct and insert in my exception table
then the normal PO related info and above custom infolog defined prior to my logic does not work like
info(strfmt("PO has been confrimed %1",purchTablePartner.PurchId));
Any help will be appreciated not sure it is normal feature.
so here I need to show infolog as it is in standard and capture exception in my exception table