We created lightning components -without namespaces- and tested them successfully. At the time of packaging, (when a namespace is added) we had to prefix nameSpace__
before every field name, object name, labels and other components in each and every component and that lead to lot of bugs.
Basically we ended up replacing all
Label.c.
withlabel.namespace
.c:componentName
withnamespace:componentName
- prefix
namespace__
before every fields and objects ending with__c' and '__r
.
We wasted almost 2 weeks for the whole process. Now our app is ready and is under review.
We are about to start the 2nd phase of product with a different namespace (say 'namespace2'). How should we approach this? Should we have to 'replace all' namespace
with namespace2
? Or as this blog suggests, should we never hard code namespace in lightning components?
Or we should hard code namespaces as per the Salesforce developer guide.
Which approach is adopted at your org?