You need to sign in to do that
Don't have an account?
Qihao Guo
Fuzion_Status__c does not exist
trigger caseCheck on Account (After update) {
List<Account> allAccounts = new List<Account>([Select id,Fuzion_Status__c,(select id from cases where status in('New','Open')) from account where id in :Trigger.new]);
List<Case> newCases = new List<Case>();
for(Account myAccount :allAccounts){
Account oldAccount = trigger.oldMap.get(myAccount.id);
if(oldAccount.Fuzion_Status__c == 'Initial Phone call' && myAccount.Fuzion_Status__c != 'Initial Phone call'){
if(myAccount.cases !=null){
Case c = new Case();
c.Accountid = myAccount.Id;
c.Type = 'ICM';
c.Origin = 'WEB';
c.Division__c = 'Case Management';
c.Status = 'New';
c.RecordTypeId = '01236000000OJLq';
newCases.add(c);
}
}
}
if(!NewCases.isEmpty()){
insert newCases;
}
}
This is my code about create a new case, but it shows the problems in the following picture
List<Account> allAccounts = new List<Account>([Select id,Fuzion_Status__c,(select id from cases where status in('New','Open')) from account where id in :Trigger.new]);
List<Case> newCases = new List<Case>();
for(Account myAccount :allAccounts){
Account oldAccount = trigger.oldMap.get(myAccount.id);
if(oldAccount.Fuzion_Status__c == 'Initial Phone call' && myAccount.Fuzion_Status__c != 'Initial Phone call'){
if(myAccount.cases !=null){
Case c = new Case();
c.Accountid = myAccount.Id;
c.Type = 'ICM';
c.Origin = 'WEB';
c.Division__c = 'Case Management';
c.Status = 'New';
c.RecordTypeId = '01236000000OJLq';
newCases.add(c);
}
}
}
if(!NewCases.isEmpty()){
insert newCases;
}
}
This is my code about create a new case, but it shows the problems in the following picture
Do you have the custom field Fuzion_Status__c on account object? Thanks