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
Tushar sharmaTushar sharma 

Custom Action not available after Namespace is added

I am using Custom Action in SF1 for simple redirect purpose. They are working fine till tomorrow. But today, when i add Namespace to my org they suddenly stop working.

I add them in the page layout but still they are not visible in SF1 detail page. I checked and test this in another org and same thing happened there. first they are working but after namespace addition they stopped working(not visible in UI).

Is this a known bug or did i missed anything. If anybody have any workaround or any solution please let me know.
NagaNaga (Salesforce Developers) 
Hi Tushar,

Typically you don't have to revisit all of your code. Most things will continue to run after the prefix is added.

But most doesn't mean all. I found these points requiring modifications:

Objects accessed via API 
as a consequence existing integrations and ETL processes
Metadata accessed via API including use of Metadata Service.cls for APEX
Usage of Ajax Toolkit
JavaScript Remoting for Apex Controllers (at least where I used alternate syntax)
places where I heavily used Schema methods together with SObject.get() and dynamic SOQL e.g. for this baby here:  Howto wildcard SELECT * to query all fields of objects in APEX?
this list is likely incomplete. Additions are welcome! 

What I try to do is wherever possible to write code that runs with and without namespace and I pay a lot of attention never to hardcode any namespace reference.

With a bit effort you'll get all references dynamically prefixed. Mind that in JS you have to do it at some places with 'prefix.' and in Apex or API typically with 'prefix__'

If you hardcode that you loose portability, meaning you can't just copy or deploy all of your code to a different Org. And this can be serious. 

For lightning I asked this question which was answer by Doug and Peter and should cover most aspects.

Please let me know if this helps

Best Regards
Naga Kiran