Hi Stefan

Sorry, but actually the exception is caught when you catch Exception::Error. However the continue statement makes the throw continue. If you remove continue it works. Probably you also want to do some manipulation on the infolog to make your own error message handling.

Regards
Thomas

-----Oprindelig meddelelse-----
Fra: [email protected] [mailto:[EMAIL PROTECTED] På vegne af Stefan Osterburg
Sendt: 25. oktober 2005 17:42
Til: [email protected]
Emne: Re: SV: [development-axapta] Catching DB dupicate key erros

same problem.

Thomas Jensen schrieb:
> Hi Stefan
>
> Try catching Exception::Error instead.
>
> Regards
> Thomas
>
> -----Oprindelig meddelelse-----
> Fra: [email protected] [mailto:[EMAIL PROTECTED] På vegne af Stefan Osterburg
> Sendt: 25. oktober 2005 11:03
> Til: [email protected]
> Emne: [development-axapta] Catching DB dupicate key erros
>
> Hello,
>
> when inserting possibly duplicate records into a table I don't want to
> check for an existing record each time before I insert but catch the
> error that the insert-call throws.
>
> The following is supposed to fill cust with two records (4711 and 4712)
> and catch the error thrown on the second 4711, however it does not work.
> What do I need to change?
>
>    custtable cust;
>     cust.setTmp();
>
>     cust.clear();
>     cust.AccountNum="4711";
>     cust.insert();
>
>     cust.clear();
>     cust.AccountNum="4711";
>     try
>     {
>         cust.insert();
>     }
>     catch (exception::Deadlock)
>     {
>      continue;
>     }
>
>     cust.clear();
>     cust.AccountNum="4712";
>     cust.insert();
>
>
>     while select cust
>     {
>      info(cust.AccountNum);
>     }
>
> Stefan Osterburg
>
>
>
>
>

> Yahoo! Groups Links
>
>
>

>
>
>
>
>

> Yahoo! Groups Links
>
>
>

>
>







Yahoo! Groups Links











YAHOO! GROUPS LINKS




Reply via email to