Set<String> roles = AccountRoleCustomSettingsNames.All;
for (AccountTeamMember member : [SELECT UserId, TeamMemberRole, Id, AccountId FROM AccountTeamMember WHERE AccountId IN :accounts AND TeamMemberRole IN :roles])
existingMemberMap.put(member.AccountId + member.TeamMemberRole, member);
for (Account account : accounts) {
process(account);
}
private static void process(Account account) {
teamRoles = Account_Team_Roles__c.getAll();
process(account, AccountRoleCustomSettingsNames.SOLUTION_SPECIALIST, account.Solution_Specialist__c);
process(account, AccountRoleCustomSettingsNames.STATE_MGR, account.State_Mgr__c);
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);
So I went into the custom settings---> a definition that handles team roles and created 'System AM APAC'. Then i went into team roles for accounts and created 'System AM APAC'.
Now all the other AccountRoleCustomSettingsNames. work, it's just the System AM APAC that gives me "Variable does not exist: System AM APAC" error.
Now i should say i've tried AccountRoleCustomSettingsNames.SYSTEM_AM_APAC and System_AM_APAC, neither work. I should note that SYSTEM_AM works fine, but in the custom settings it's listed as System AM (api name as well) so that shouldn't matter....i can seem to figure out whats causing the issue. I know it's a static object, maybe it needs a day?