0

I am trying to copy a visualforce page, that is a part of a managed package, so that is to say recreate it, and then add a couple of lines of functionality to it so that I can add something to it, and then have it otherwise perform the same way. When I try to upload it with the developer tools however, it is returning an error

The installed managed class 'amazonconnect.ACSFCCP_CallTaskController' is not visible

I have bolded the line in the code for your convenience

I have tried changing the API version of the visualforce page, so that it reflects the same one within the amazonconnect.ACSFCCP_CallTaskContoller, but the API version in that is unavailable to me.

My understanding is that if I change the scope of the visualforce page to be global in scope, that I may then have access to the amazonconnect.ACSFCCP_CallTaskController. I'm not clear on how to do that.

What I'm trying to accomplish is accessing the amazonconnect.ACSFCCP_CallTaskController within the below code. I'm not concerned how it takes place, so long as it does so in a a correct way. Does anyone know how to get my new visualforce page to access the troublesome class?

below is the code itself:

<apex:page id="ACSFCCP_CallTask" lightningStylesheets="true" standardcontroller="Task" extensions="***amazonconnect.ACSFCCP_CallTaskController***">
    <apex:includeScript value="/support/console/44.0/integration.js"/>
    <apex:slds />
    <style>
        .comboField select {
            width: 150px;
            margin-right: 5px;
        }
        .hidden {
            display: none;
        }
    </style>

<script type="text/javascript">
function closeWin() {
         window.close();   
        }
    </script>

    <div class="slds-scope">
        <apex:form styleClass="slds-scope">
            <apex:pageBlock mode="maindetail">
                <apex:pageBlockSection columns="1">
                    <apex:inputField style="width:240px;" value="{!task.Subject}" required="true"/>
                    <apex:inputField styleClass="comboField" value="{!task.WhoId}" />
                    <apex:inputField styleClass="comboField" value="{!task.WhatId}" />
                    <apex:inputField style="width: 335px; height: 100px" styleClass="slds-textarea" label="Comments / Notes" value="{!task.Description}" />
                    <apex:selectList style="width: 335px;" styleClass="slds-select" value="{!task.CallDisposition}" multiselect="false" size="1" rendered="{!dispositionCodes.size > 0}">
                        <apex:selectOptions value="{!dispositionCodes}"/>
                    </apex:selectList>
                </apex:pageBlockSection>
                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton styleClass="slds-button slds-button_brand" action="{!quicksave}" oncomplete="closeWin()" value="Save and Close" />
                </apex:pageBlockButtons>
                <apex:pageMessages />
            </apex:pageBlock>
        </apex:form>
    </div>
</apex:page>

2 Answers 2

2

To add to @sfdcfox's 100% correct answer:

All packaged apex, including VF controllers, is purely internal to a managed package unless it is marked global access.

Note, however, that it is likely the package developer would not want to promote a controller (and any selected methods on it) to global because once they do they cannot change them in or remove them from the package.

If what you need to do involves something like adding extra fields in the UI for display and/or editing then the package developer may agree to support field set based configuration, for example, since this does not require making anything global at all.

You should let the developer know what it is you want to achieve, rather than ask for the class to be made global - that way you are more likely to achieve a positive outcome with them.

NB: any AppExchange partner is also likely already working to replace Visualforce with Lightning UI stuff. Visualforce is not a good technology to rely on for future work... perhaps they have some LWCs you can drop in a page instead?

PS: I write this being a Salesforce ISV partner developer, we develop own own packages available through the AppExchange, so know from past experience how detrimental global is to on-going package evolution.

1

In order to access a controller outside the package, the class itself must be global. If it is not, you must contact the publisher to see if it can be made global, or if there is an alternative way to access the logic you're trying to access.

2
  • So what you're saying is is that the class must be made global that I'm trying to access, not the one that I'm creating - correct? Jan 4, 2022 at 21:30
  • @Steve Correct. You cannot fix this without assistance from the developer.
    – sfdcfox
    Jan 4, 2022 at 22:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .