Hi experts,
I am working on ledger journal validation. I want to store validation error into one of the table.
I have wrote following code to catch validation error but unable to catch validation error and following
code showing the standard error message where as I want to catch and store validation error.
I am getting following validation error message but requirment to catch and store error
Code:
public class TestClass
{
public static void main(args _args)
{
LedgerJournalTable ledgerJournalTable;
LedgerJournalCheckPost ledgerJournalCheckPost;
SysInfoLogEnumerator infoLogEnum;
SysInfologMessageStruct infoMessageStruct;
str integrationMessage;
LedgerJournalTable = LedgerJournalTable::find('JB2551921');
try
{
ledgerJournalCheckPost = LedgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable, NoYes::no);
// ledgerJournalCheckPost.run();
LedgerJournalCheckPost::processOperation(ledgerJournalCheckPost);
}
catch(Exception::Error)
{
info('Catch');
infoLogEnum = SysInfoLogEnumerator::newData(infolog.infologData());
while(infoLogEnum.moveNext())
{
infoMessageStruct = SysInfologMessageStruct::construct(infoLogEnum.currentMessage());
integrationMessage = integrationMessage + infoMessageStruct.message() + '/';
info(strfmt('Error message of failure is %1',integrationMessage));
}
}
}
}