I've installed a managed package (released version) on a sandbox and it doesn't work because Namespaces are not removed on the Custom fields API name from Lightning component controllers :
From my dev org or any enterprise org where I've installed the package, the app works just fine: Namespaces are removed on Custom fields API name when receiving data: Apex actions return Custom_field__c instead of Mynamespace__Custom_Field__c.
But when testing on Sandbox, namespaces are not removed and my app just crashes: Custom_Field__c is undefined everywhere I expect data from apex actions.
EDIT:
From my dev org this why i get:
...
var results = a.getReturnvalue();
var name = results.record.Custom_field_name__c
console.log(name) ; //display John Doe
...
From a sandbox org, i get this
...
var results = a.getReturnvalue();
var name = results.record.Custom_field_name__c
console.log(name) ; //display undefined
And if i do console.log(results) from the dev org i have:
{record : {''Custom_field_name__c'': '' John Doe''}}
...
And from the sandbox...
{record : {''MyNameSpace__Custom_field_name__c'': '' John Doe''}}
Could you please advise how I can solve this? Any advice will be very much appreciated! A 1000 thanks!