Hi,
In my Try..Catch() block, I'm calling existing function for posting Sales Order Invoice, however when there is something happened in the invoice process, the error does not catch. For example the code is like this :
#OCCRetryCount
While select myOpenSalesTable
{
ttsbegin;
Try
{
SalesFormLetter formLetterObj;
formLetterObj = SalesFormLetter::construct(DocumentStatus::Invoice);
formLetterObj.update(myOpenSalesTable);
}
catch(Exception::Error)
{
.
.
retry;
}
catch (Exception::UpdateConflict)
{
.
.
retry;
}
ttscommit;
}
As I put my Retry inside the catch, but because it is not "trapped" inside, the process will stop "abruptly"
I have 2 questions about this:
1. How to make the FormLetter.update() process, when it is error, also trapped in my Catch()
2. Since I included #OCCRetryCount macro in my class, while the process is inside "While..." loop, should I still need compare the number of Retry and make the process continue to the next record when error happened and already exceeded the retry account ? something like this :
catch(Exception:Error)
{
if(xSession::CurrentRetryCount() >= #RetryNum)
{
error();
continue;
}
else
{
retry;
}
}
Thanks,