How to catch system exception of duplicate records found and show own message
April 4, 2009 Leave a comment
static void CatchException(Args _args)
{
CustTable custTable;
SysInfoLogLevel prevLevel = infolog.infologLevel();
try
{
infolog.setInfoLogLevel(SysInfoLogLevel::None);
custTable.AccountNum = “1″;
custTable.insert();
infolog.setInfoLogLevel(prevLevel);
}
catch(Exception::DuplicateKeyException)
{
infolog.setInfoLogLevel(prevLevel);
info(“DuplicateKeyException”);
}
}
This is Amir Nazim from Karachi Pakistan, having very good experience on Microsoft Dynamics AX and related technologies, currently working as Microsoft Dynamics Ax Sr. Development Engineer and Solution Architect in MBS (Implementation) team. 