How to Bypass Next in COC in D365 X++
To Skip the next call use try catch
protected void addPurchaseLines(int _line)
{
try
{
throw Exception::Error;
next addPurchaseLines(_line);
}
catch(Exception::Error)
{
// write your logic here
}
}
if want to skip the code between ttsbegin/ ttscommit than use
throw Exception::UpdateConflict;
instead of throw Exception::Error;
protected void addPurchaseLines(int _line)
{
try
{
throw Exception::UpdateConflict;
next addPurchaseLines(_line);
}
catch(Exception::UpdateConflict; )
{
// write your logic here
}
}
Regards
Muhammad Farraz
email: farazjaved01@gmail.com
Comments
Post a Comment