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
SUMANTH ELLURUSUMANTH ELLURU 

o make Account ‘Active’ once any opportunity associated to it reaches ‘Qualification’ stage.

Create an insert/update trigger on Opportunity such that when the Opportunity Stage = ‘Qualification’, check if the corresponding Account field IsActive status = true. If IsActive=false then update IsActive=true.
Note: ‘IsActive’ is not a standard field. Create a custom checkbox field named ‘IsActive’ on Account before proceeding with the trigger
pradeep kumar yadavpradeep kumar yadav
Ask questions in which you stuck, We community members are not here to write code for you.(poke) 
SUMANTH ELLURUSUMANTH ELLURU
i have tried this
er UpdateNoOfContact on Contact(after insert){

try{
Log_Error__c logObj = new Log_Error__c();
List<Account> accListToBeUpdated = new List<Account>();
Map<ID,Account> accMap = new Map<ID,Account>([SELECT id,name,No_Of_Contacts__c FROM Account WHERE id in :accListToBeUpdated]);
for(Contact con : Trigger.new){
Account acc = new Account();
if(con.AccountId != NULL){
acc = accMap.get(con.AccountId);
if(acc.No_Of_Contacts__c == NULL){
acc.No_Of_Contacts__c = 1;
}
else{
acc.No_Of_Contacts__c += 1;
}
}
accListToBeUpdated.add(acc);
}
if(accListToBeUpdated.size() > 0){
update accListToBeUpdated;
}
}
catch(DMLException dmlEx){
Log_Error__c logObj = new Log_Error__c();

logObj.Exception_Message__c = dmlEx.getMessage();
logObj.Line_Number__c = dmlEx.getLineNumber();

logObj.Type_of_exception__c = dmlEx.getTypeName();
INSERT logObj;
}
catch(Exception expMsg){
Log_Error__c logObj = new Log_Error__c();
logObj.Exception_Message__c = expMsg.getMessage();
logObj.Line_Number__c = expMsg.getLineNumber();
logObj.Type_of_exception__c = expMsg.getTypeName();
INSERT logObj;
}
}

Compile Error: Trigger name, UpdateNoOfContact, exists on different SObject type: Account at line -1 column -1
pradeep kumar yadavpradeep kumar yadav
You asked Question for "trigger on Opportunity " and the above trigger is on Contact.
pradeep kumar yadavpradeep kumar yadav
Error in Above code is solved
try{
    Log_Error__c logObj = new Log_Error__c();
    List<Account> accListToBeUpdated = new List<Account>();
    Set<ID> setOfAccID = new Set<ID>();
    for(Contact con : Trigger.new) {
        setOfAccID.add(con.AccountId);
    }
    Map<ID,Account> accMap = new Map<ID,Account>([SELECT id,name,No_Of_Contacts__c FROM Account WHERE id in :setOfAccID]);
    for(Contact con : Trigger.new){
        Account acc = new Account();
        if(con.AccountId != NULL){
            acc = accMap.get(con.AccountId);
            if(acc.No_Of_Contacts__c == NULL){
                acc.No_Of_Contacts__c = 1;
            }
            else{
                acc.No_Of_Contacts__c += 1;
            }
        }
        accListToBeUpdated.add(acc);
    }
    if(accListToBeUpdated.size() > 0){
        update accListToBeUpdated;
    }
}
catch(DMLException dmlEx){
    Log_Error__c logObj = new Log_Error__c();
    
    logObj.Exception_Message__c = dmlEx.getMessage();
    logObj.Line_Number__c = dmlEx.getLineNumber();
    
    logObj.Type_of_exception__c = dmlEx.getTypeName();
    INSERT logObj;
}
catch(Exception expMsg){
    Log_Error__c logObj = new Log_Error__c();
    logObj.Exception_Message__c = expMsg.getMessage();
    logObj.Line_Number__c = expMsg.getLineNumber();
    logObj.Type_of_exception__c = expMsg.getTypeName();
    INSERT logObj;
}
}

 
SUMANTH ELLURUSUMANTH ELLURU
Thank you its working