[SalesForce] Lightning: WARNING: error in server action and FATAL_ERROR System.StringException: Invalid id:

When performing an action on a Lightning component, I am getting a warning in the console:

WARNING: Error in the server action response:An internal server error has occurred
Error ID: 2139358423-25462 (119852647)

At the same time, I see a debug log appear in the developer's console stating

FATAL_ERROR System.StringException: Invalid id:

The problem is that the debug logs and warning message don't have an indication of what code is causing the problem. How would I go about finding out what is causing the errors? I realise there isn't a lot to go on here but there's no point posting code when I don't know what code to post.

Best Answer

Usually this happens when you assign a string to an ID variable which turns out to be an invalid id (string should be valid 15 or 18 digit id). In your case please check whether string variable assigned to ID variable is not a blank or invalid id.

Related Topic