Hi!
How can I determine if a DatabaseException is a unique constraint error within OutSystems?
Hi,
Unique constraint error means you tried to write twice a value into a unique field. And i think outsystems gives an error something like 'unique constraint violated' .
Also you can use the exception handler to catch the exception and check its type.
hope it helps.
Thanks.
Hi Hiroshi, For now, we cannot determind by Exception Type (or Exception Class like in hi-code platform). Still we can workaround by checking the Exception message content by using built-in Index function to detect that at Exception Handle. For example, duplication exception usually start with "Cannot insert duplicate key row", for example: Index(AllExceptions.ExceptionMessage, "Cannot insert duplicate key row") > -1