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
divey sainidivey saini 

Error: Compile Error: Initial term of field expression must be a concrete SObject:

I am getting the following error 
Error: Compile Error: Initial term of field expression must be a concrete SObject: List<Customer__c> at line 21 column 6

Code:
------------------
trigger RegionT on Customer__c (after insert, after update) {

SET<String> name = new SET<String>();

 List<String> CustwithOpps = new List<String>();
 List<Customer__c> Custom = new list<Customer__c>();

for (Customer__c b : Trigger.new)
{
  if (trigger.oldmap.get(b.id).Region__c != b.Region__c && Trigger.isupdate) 
{  
   CustwithOpps.add(b.region__c);
   name.add(b.id);
 }
 if (trigger.isinsert) 
 { CustwithOpps.add(b.region__c);
   name.add(b.id);
   }
 }
 
 if (Custom.BillingState__c = True)
{
}
    List<Bank__c> a = [SELECT ID,Name,Region__c FROM Bank__c];

for (Bank__c c: a)
  {

for (Customer__c b : [SELECT ID,Name,Region__c,Bank__c FROM Customer__c WHERE ID IN:Name])
  {
  
if (c.Region__c.contains(b.Region__c))
  {
  b.Bank__c = c.id;
 Custom.add(b);
  }

  }
}
   if (Custom.size()>0)
 update Custom;
   }
Deepak GulianDeepak Gulian
Custom is a list variable and you are not adding any value into this list, so its a wrong way to access the object field.
if (Custom.BillingState__c = True)
 {
}
//Custom.BillingState__c is a wrong declaration
Tolga SunarTolga Sunar
This part in your code does not add any functionality to your code, and is wrongly declared.
 
if (Custom.BillingState__c = True)
{
}