function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Variable does not exist: except it does? From custom settings

private static void process(Account account) {
        teamRoles = Account_Team_Roles__c.getAll();
process(account, AccountRoleCustomSettingsNames.STRATEGIC_ACCOUNT_DIRECTOR, account.Strategic_Account_Mgr__c); process(account, AccountRoleCustomSettingsNames.STRATEGIC_ACCOUNT_SYSTEM_SALES, account.Strategic_Acct_System_Sales__c); 
process(account, AccountRoleCustomSettingsNames.STRATEGIC_ACCT_VP, account.Strategic_Acct_VP__c); if(account.Region__c != 'Asia' || account.Region__c != 'ANZ') process(account, AccountRoleCustomSettingsNames.SYSTEM_AM, account.System_AM__c); 
else process(account, AccountRoleCustomSettingsNames.SYSTEM_AM_APAC, account.System_AM__c);
 process(account, AccountRoleCustomSettingsNames.SYSTEM_SALES_DIRECTOR, account.Systems_Sales_Director__c);

Now all the other 'AccountRoleCustomSettingsNames.<api name>' work. 

So yestarday i go into custom settings and then into a prexisting custom settings defintion, one that manages account team roles. Then i hit manage and create a new team role named, 'System AM APAC'

In dev console i get 

'Variable does not exist: SYSTEM_AM_APAC'

So i checked in account teams, and it dawns on me "There isn't an account team named 'System AM APAC'" so i created one, and still I get the Variable does not exist error...
Raj VakatiRaj Vakati
It shoule be System _AM_APAC not SYSTEM_AM_APAC i belive
@Raj V i thought that as well but all the other AccountRoleCustomSettingsNames.<name> are the same. IE the STRATEGIC_ACCT_VP is listed in the custom setting as Strategic_ACCT_VP 
Raj VakatiRaj Vakati
Go and update the System _AM_APAC to SYSTEM_AM_APAC  then it will work