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
Qihao GuoQihao 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?User-added imageUser-added image
PriyaPriya (Salesforce Developers) 

Hi Qihao,

Fuzion_Status__c, Is it a field or object ?

Thanks & regards,

Priya Ranjan

Bryan Leaman 6Bryan Leaman 6
I don't know anything about Fuzion_Status__c, but if "Fuzion" is an installed application, then you probably need 2 underscores instead of just 1 before "Status__c" --- aka "Fuzion__Status__c" (or spaced so you can see it ... "Fuzion _ _ Status _ _ c").
Bryan Leaman 6Bryan Leaman 6
Another possibility might be that you are not authorized to the field or maybe do not have a license to the Fuzion product. Or maybe just that "Fuzion_Status__c" is their field name, but you need to pre-pend that product's namespace ... {theirnamespace}__Fuzion_Status__c.