Why do I get an Internal Salesforce.com Error when trying to pass an array of sObject values to an Apex controller action method?
I've posted a simple gist to demonstrate this problem to GitHub: https://gist.github.com/martyychang/76867c92f19808b6a7b7
The way to reproduce the problem is:
- Enable debug logging for yourself
- Launch oneLead.app (after you've created everything in the gist and tweaked the namespace references)
- Submitting a single lead works fine using the first Submit button, as expected
- Adding multiple leads and then submitting all of them using the bottom Submit button causes the Internal Salesforce.com Error
Is there something simple that I'm doing wrong? All I want to do is pass a List object as a parameter to my Apex controller from my Lightning component.
Best Answer
The problem is deep inside of the transport/marshalling interface layer between Lightning Components and Apex and will need to be fixed by my team.
For now I have developed a generic workaround using a small amount of Apex.
and a small corresponding change to the client side controller (oneLeadController.js) calling this: