Timeline for Best practice saving sObject[] in Lightning app
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 22, 2017 at 10:26 | comment | added | Brian Kessler | Doesn't work for me. I get errors that the server can't read the sObject. I tried adding the type to each item in the array before uploading, but receive exactly the same error. :-( ... Locker service.... :-( | |
Aug 30, 2016 at 6:10 | comment | added | Caspar Harmer | Probably the easiest way of preventing these is to throw a try{}catch(){} block around your controller method and return a status string or an error string. Actually, I often return an Result object, with a success bool and a message. | |
Sep 30, 2015 at 13:20 | comment | added | jheuvel | Another finding is that exceptions thrown from Apex, do not show up as a useful error message in the response, but as the, by now infamous, "An internal server error has occurred Error ID: xxxx..." message... Anyone found a way around that yet? | |
Sep 30, 2015 at 13:15 | comment | added | jheuvel | I have implemented both methods, to see what would work best. An additional consideration here, is that when an event is sent to the individual line components to perform a record save, these remote actions will all end-up in the same execution context in apex. (due to the optimization the framework performs when sending calls to the back-end) This could result in hitting governor limits, depending on your situation. I found that you can enforce separate contexts by applying a small delay, but would like it better if the framework supported this. However, I have not found a way to do so yet. | |
Sep 24, 2015 at 13:03 | comment | added | Moshe Karmel | Depending on what kind of errors you're trying to catch, you may be able to catch them prior to the mass save (client side). If you can't, then I guess you would just save one at a time... | |
Sep 22, 2015 at 7:29 | comment | added | jheuvel | Hi Moshe, thanks for your answer. This is similar to how I initially implemented this, but when I started to think about the error handling, I was inclined to move this logic to the individual component solution, so that partial saves would also work. How would you handle save errors in this scenario? | |
Sep 20, 2015 at 19:58 | history | answered | Moshe Karmel | CC BY-SA 3.0 |