+ Start a Discussion

Referencing a controller extension that has a namespace


I'm trying to create a visualforce page and reference an extension that is located in a managed package and has a namespace "nsp".  Note: the visualforce page is not in the managed package.  The visualforce page looks like this:



<apex:page standardController="Account" extensions="nsp__testextension">



However when I try to save the above the error is "Error: The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores." 


The controller extension looks like this:


global class ControllerExtension{
    global ControllerExtension(ApexPages.StandardController stdController) {

    global static String helloWorld(String recordId) {
        return 'Record id in context: '+recordId;




Are extensions with namespace supported?





Best Answer chosen by Admin (Salesforce Developers) 


Try referencing as: