thanks everyone. Removing "continue" and catching "Error" did the trick.
Stefan
Karsten Krabbes schrieb:
> Hi Stefan,
> also its not possible to catch an error inside a tts loop ...
>
> br
> karsten
> --- In development-axapta@yahoogroups.com, "Thomas Jensen" <[EMAIL PROTECTED]>
> wrote:
>
>>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: development-axapta@yahoogroups.com [mailto:development-
>
> [EMAIL PROTECTED] På vegne af Stefan Osterburg
>
>>Sendt: 25. oktober 2005 17:42
>>Til: development-axapta@yahoogroups.com
>>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: development-axapta@yahoogroups.com [mailto:development-
>
> [EMAIL PROTECTED] På vegne af Stefan Osterburg
>
>>>Sendt: 25. oktober 2005 11:03
>>>Til: development-axapta@yahoogroups.com
>>>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
>
>
>
>
>
>
SPONSORED LINKS
Programming languages | Microsoft axapta | Support exchange |
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.