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
rahul kumar 215rahul kumar 215 

I am writing this code but its giving error. can somebody correct this?

public class BannerMessageControllerTxt {
    @AuraEnabled
    public static List<BannerMessage__c> getBannerBasedOnCommunity(String URL)
    {
        String communityName = URL.substringAfter('/').subStringBefore('/');
        List<BannerMessage__c> Bannermsg = BannerMessage__c.getAll().values(); //create instance for text messageList
        List<BannerMessage__c> BmText = new List<BannerMessage__c>();
        
        for(BannerMessage__c queVar:Bannermsg)
        {
            //System.debug('TEST::1::'+queVar.CommunityName__c+'::'+communityName);
             if(communityName!=Null && queVar.CommunityName__c!=NULL && BannerMessage__c.CommunityName__c == communityName)
            {
                BmText.add(quevar);
            }
        }
        return BmText;
    } 

}
Nayana KNayana K
if(communityName!=Null && queVar.CommunityName__c!=NULL && queVar.CommunityName__c == communityName)