Mar 23, 2015

Syntax of Try {} catch {} for updation in X++

void clicked()
{

#OCCRetryCount   

#task;  

super();

try

     // logic
}
catch (Exception::Deadlock)

{
      retry;

}
catch (Exception::UpdateConflict)

{
       if (appl.ttsLevel() == 0)

      {
           if (xSession::currentRetryCount() >= #RetryNum)

          {
                throw Exception::UpdateConflictNotRecovered;

          }
      else

     {
           retry;

     }
}
else

{
     throw Exception::UpdateConflict;

}
}
catch (Exception::Error)

{
       throw error("Label");

}
    Table_ds.research();

}

No comments: