Does anyone know why I can't do this?
Here's a domain class
public class Opportunities extends fflib_SObjectDomain {
public static Set<String> DIRECT_RECORD_TYPES = new Set<String> { 'a', 'b', 'c' };
public static Set<String> INDIRECT_RECORD_TYPES = new Set<String> { 'd', 'e', 'f' };
}
The problem is in this class
public class MyClass {
public void myMethod() {
strRecordTypeName = ...
if (Opportunities.DIRECT_RECORD_TYPES.contains(strRecordTypeName)) {
// do stuff
}
}
}
What I get is:
Compile Error: Variable does not exist: DIRECT_RECORD_TYPES at line x
I'm mystified. I guess I can make a static method that returns the set. I thought maybe it's because Opportunities doesn't have a zero-argument constructor. But I added one and that didn't help. I also tried using a static method instead of a static Set variable to no avail.
opportunities
.