Try using Throw exception::error instead of throw
error(“…”). From:
Raul Llorente Peña/OPENSOLUTIONS [mailto:[EMAIL PROTECTED] In 2.5, sentences blocks try/catch aren't managed by
Axapta when session is a COM one. Let's see this example code (doesn't matter wherever you
put it to be executed); TableErrors tableErrors; //A new table created, with only
a string field called error. try { throw error('Error!!'); } catch (Exception::error) { info('The error has been catched'); tableerrors.error = 'one'; tableErrors.insert(); } If this code is executed in an 'human' session, the user
will see "Error!! The error has been catched", and then, when
examining the table TableErrors, user will see that a new record has beeb
created, with value 'one'. But, when code is executed via COM (a COM session), the
error is thrown but not managed, this is, no record in tableErrors will appear
at all. This is, it appears as if try/catch sentences were
invisible to COM sessions. Why? Is there any workaround for this issue? This is normal in 3.0, too? Raúl Llorente Peña
Sharing the knowledge on Axapta. Yahoo! Groups Links
|
- RE: [Axapta-Knowledge-Village] Why sente... Bayliss, Barry
- RE: [Axapta-Knowledge-Village] Why ... Raul Llorente Peña/OPENSOLUTIONS