I am trying to retrieve a custom setting that I made with this code:
public static String getCustomKey(){
AP_Mobile_Key__c APMobileKey = AP_Mobile_Key__c.getInstance('AP Mobile Key');
String myCCVal = APMobileKey.Key__c;
if(APMobileKey != null){
System.debug(myCCVal);
return myCCVal;
}
return 'No key';
}
When I try to run it, i get error: Invalid SetupOwner for Custom Settings: AP Mobile Key
These settings exist, I just created them. I cant see to find any reference to this error using Google.
list
type removes the error but now its null when I do:AP_Mobile_Key__c APMobileKey = AP_Mobile_Key__c.getInstance('AP Mobile Key');
Even though these settings are present. – Kevin Hernandez Jul 22 at 23:17