You need to sign in to do that
Don't have an account?
divey 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;
}
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;
}
if (Custom.BillingState__c = True)
{
}
//Custom.BillingState__c is a wrong declaration