Dear Community,
In which cases will cause errors or exceptions when using the CreateOrUpdate Entity action and how can I catch these errors or exceptions?
Thanks
Hi,
You can catch error by using exception handling inside your action.
Below link is for your reference:
https://success.outsystems.com/documentation/11/building_apps/handling_exceptions/
There is many ways to come exceptions when using the CreateOrUpdate Entity action:
1. Sometime some values are null.
2. Id not generating and many more with using exception you can get proper error why error is coming in that action.
Need any help you can share error screenshot so we will clear more on that. Thanks!!!
Regards,
Rajat
Hi ndy,
Note that in most cases, you do not want to use CreateOrUpdate, as it is slower than a single Create or a single Update (since the database must test whether the record exists first). So if you already know the record exists, use Update, otherwise use Create. A typical entity save wrapper does something like this:
Your answer is helpful. Thanks. Can I have your demo file, @Kilian Hekhuis ?
Sure, here you go. I'd appreciate it if you mark my answer above also as Solution, thanks!
Can I know the data recording time on Service Center, @Kilian Hekhuis ?
I'm not sure what you mean?
Just like we can see the query time of a aggregate in Service Center. Can we see the data write time?
You cannot, as far as I known. But also be aware that the "Duration" column shows increments of about 15ms, so it isn't very precise.