Although I am having this field in my custom settings it shows Error : Variable does not exist. Please find below code snippet. Can someone let me know what could be the reason?
Code Snippet:
FieldInsightsTrackerSettings_ABV__c userSet;
if(LoginUserFranchiseName!=null)
userSet = FieldInsightsTrackerSettings_ABV__c.getInstance(LoginUserFranchiseName);
FieldInsightsTrackerSettings_ABV__c userSet ; //= FieldInsightsTrackerSettings_ABV__c.getInstance(LoginUserFranchiseName);*/
if(userSet!=null)
{ Franchise = userSet.Use_Franchise_abv__c;
if(!Franchise )
{FieldInsightsTrackerSettings_ABV__c userSettings = FieldInsightsTrackerSettings_ABV__c.getInstance(LoginUserProfileId);}
else { FieldInsightsTrackerSettings_ABV__c userSettings= FieldInsightsTrackerSettings_ABV__c.getInstance(LoginUserFranchiseName);}
}
System.debug('----->'+userSettings); // This line throws error