function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nadim Mujawar 5Nadim Mujawar 5 

ssertion Failed!: $A.addValueProvider(): '$Record' has already been registered. : false . Not able to switch to Lightning Mode

When i try switch to Lightning mode i get following error :

This page has an error. You might just need to refresh it. Assertion Failed!: $A.addValueProvider(): '$Record' has already been registered. : false

Kindly help
Best Answer chosen by Nadim Mujawar 5
NagendraNagendra (Salesforce Developers) 
Hi Nadim,

Sorry for this issue you are encountering.

There is a field on the User object called 'UserPreferencesLightningExperiencePreferred' which stores the user value for which UI they should be viewing.  If the value is true then the users will be routed to Lightning if it is false it displays the Classic view.

You could try having the users log out of Salesforce and then use data loader to set that value of this field to 'true' for their account and then have them log back in at which point they should be routed to lightning.  If the user's don't log out then I don't think you will be able to make this work as there seems to be some session variable or cookie setting which keeps the classic UI active.  

I tested this on my end and it routed my test account between the two experiences based on the value on a consistent basis.

Hope this helps.

Kindly mark this as solved if the information was helpful so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Nadim,

Sorry for this issue you are encountering.

There is a field on the User object called 'UserPreferencesLightningExperiencePreferred' which stores the user value for which UI they should be viewing.  If the value is true then the users will be routed to Lightning if it is false it displays the Classic view.

You could try having the users log out of Salesforce and then use data loader to set that value of this field to 'true' for their account and then have them log back in at which point they should be routed to lightning.  If the user's don't log out then I don't think you will be able to make this work as there seems to be some session variable or cookie setting which keeps the classic UI active.  

I tested this on my end and it routed my test account between the two experiences based on the value on a consistent basis.

Hope this helps.

Kindly mark this as solved if the information was helpful so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra
This was selected as the best answer
Nadim Mujawar 5Nadim Mujawar 5
Thanks Nagendra. I did this through query on user object by making value of   UserPreferencesLightningExperiencePreferred to true. It worked. 
Hat's off to your analysis.