Article #000001054
Summary
Users sporadically produce an error when accessing the focus matters tab.
Question
Focus Matters Error! Malformed JSON: Expected
The Malformed JSON Error within Focus Matters is usually encountered when the underlying code utilizes the logged-in user's context via Salesforce classic environment methodology. To retrieve the logged-in user's Focus Matters metadata, we need to execute some background API calls, which require enhanced security permissions. These security permissions were (by default) enabled for classic user's context and continue to work within lightning as well, but limited to Visualforce technology only. The platform restricts its usage within the lightning component. Thus, it sometimes gets blocked when referencing the user's session retrieved using the classic methodology.
This method was introduced and is stable enough to work perfectly within the Salesforce classic environment and was supported for the Salesforce lightning environment. However, with the ever evolving Salesforce platform, certain functionalities are now considered legacy functions but mostly continue to function well. In some rare situations, we have identified that this legacy method will cause this error, which may get resolved on its own (by either logging out and back in or clearing your browser's cache, etc), but it is prone to occur again as the error is induced in some enhanced security settings enforced within the organization.
Resolution/Workaround
To overcome this, we introduced a new way, which the Salesforce platform supports for a Lightning experience, and we named it Secured Logins for Focus Matters. This is robust enough to work within Lightning and is part of the platform's suggested best practices.