1

I have an issue where only some of my global variables in my managed package are visible. Ex: I can access bool1 and bool2 in developer console and in non managed classes but bool3 and bool4 give a not visible error when I try to reference them. Through the developer console code complete I am able to auto complete and see bool3 and bool4 but I cannot execute the code nor save the non managed class. My class from the managed package:

global with sharing class MyClass
{
   global static Boolean bool1 = false;
   global static Boolean bool2 = false;
   global static Boolean bool3 = false;
   global static Boolean bool4 = false;
}

Code I'm executing

~logic here
NAMESPACE.MyClass.bool3 = true;
~logic here
NAMESPACE.MyClass.bool3 = false;
~logic here

The above is how my class and anonymous code block roughly works. I'm not sure what I could be missing here since its possible to reference about half of the global variables in the global class in the managed package from non managed classes and dev console. I don't think its a permission issue since I'm able to access the class and reference some of the variables but I'm not entirely sure.

2
  • Are you sure you have the right version of the managed package installed on the org?
    – Phil W
    Commented Sep 11 at 20:59
  • The installed package is the latest version. The code I'm writing is done via logging into subscribers and using dev console. I've verified that the variables exist in the managed package thats been installed. I'm not sure if logging in via subscribers is causing this issue.
    – Franky
    Commented Sep 12 at 1:37

1 Answer 1

1

After some digging I found out I could use the anonymous code executor to access the variables and only couldn't from the class. This Salesforce forum thread led me on the right path. I realised that the version of the class was massively outdated version 48 when the managed class was on version 59. After deleting the non managed class and recreating it on version 59 I was able to access all variables properly. I dismissed this solution earlier simply changing the version number of the class directly did not fix the issue. I had to delete the class entirely to resolve the problem.

You must log in to answer this question.

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