Currently, I'm using Apex methods to insert, update, and delete records in my Lightning App. These methods call Database class methods which return SaveResult (or DeleteResult). These results can contain an array of errors, making it possible to determine which field an error applies to, and I can then display that particular error message at the correct position on the screen, next to the field it applies to.
I wanted to try using LDS and force:recordData as a way of eliminating some Apex code, and also have components auto-refresh if a record they've loaded gets changed (even outside the app), without having to poll or have the user manually refresh.
However, per the below developer's guide info, it looks like force:recordData only supports one String error message in the form of a targetError attribute:
I'm guessing if multiple errors are encountered during an insert or update operation, they're all concatenated together in one String, not as discrete errors (like SaveResult has for example).
Has anybody played around with this enough to know for sure? I wanted the ability to handle errors at field-level granularity, and now I'm wondering if LDS supports this?
Thanks for any insight on this.