You need to sign in to do that
Don't have an account?
Qihao Guo
why Fuzion_Status__c does not exist
trigger addCase 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 to create a case and I have just create an object called fuzion status but why it still shows variable does not exist?
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 to create a case and I have just create an object called fuzion status but why it still shows variable does not exist?
Hi Qihao,
Fuzion_Status__c, Is it a field or object ?
Thanks & regards,
Priya Ranjan