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
balaji aluri 16balaji aluri 16 

Apex Classes Deployment

Hi,

I am having 'AccountMergeController' apex class in develoer sandbox and have deployed to Fullcopy sandbox. And in developer sandox i have added some logic to the controller and deployed again to fullcopy.

In this deployement will the controller in fullcopy get override with the controller in Developer sandbox? or another calss will create?


Thanks,
Balaji A
Best Answer chosen by balaji aluri 16
Amit Chaudhary 8Amit Chaudhary 8
If you are deploying any class from Developer sandbox to full copy then if class is already exist in Full Copy then class will override but if class will not available in full copy then new class will create

All Answers

Waqar Hussain SFWaqar Hussain SF
Hi Balaji,

The controller will be overrided in the fullcopy sandbox. 
Amit Chaudhary 8Amit Chaudhary 8
If you are deploying any class from Developer sandbox to full copy then if class is already exist in Full Copy then class will override but if class will not available in full copy then new class will create
This was selected as the best answer
legit daralegit dara

Buy real and fake driver's license. passports, ID cards, VISA (legitdocuments120@gmail.com) 

We offer both fake and original high-quality IDs and Passport ,Visa,Driving License,ID CARDS,marriage certificates,diplomas etc buy now high quality
-We have the best HOLOGRAMS AND DUPLICATING MACHINES With over 13million of out documents circulating over the world. -IDs Scan-yes...

-HOLOGRAMS: IDENTICAL -BAR CODES: IDS SCAN
-UV: 
YES -Passports FAKE IDS WITH FAST SHIPPING - EMAIL SUPPORT Fake ID's Over state drivers license cards and State ID cards available. Includes state driver's license hologram and magnetic strip or bar code on back. 2 business day shipping order (shipping and handling). The BEST authentic fake ID's on the web. Same quality, high resolution that Department of Motor Vehicles use. Send current .JPG or .GIF of current license with picture and changes in NAME, DOB, #LICENSE, RESTRICTIONS, etc. we produce the best fake ID online we sell UK/EU fake ID, Canadian fake ID, Australian fake ID and fake IDs for many other countries from fake passports to fake driving licenses to fake bank statements we have your identification needs covered. Our fake IDs include all security features such as genuine holograms, ultraviolet watermarks, intaglio printing, special paper, fluorescent dyes, RFID chips, bar codes corresponding to your details and more. Our fake IDs are identical to the real thing no other site will offer you this quality we are the best. new identity protect your privacy and take back your freedom..

Contact e-mails:=========== legitdocuments120@gmail.com
legit daralegit dara

Buy real and fake driver's license. passports, ID cards, VISA (legitdocuments120@gmail.com) 

We offer both fake and original high-quality IDs and Passport ,Visa,Driving License,ID CARDS,marriage certificates,diplomas etc buy now high quality
-We have the best HOLOGRAMS AND DUPLICATING MACHINES With over 13million of out documents circulating over the world. -IDs Scan-yes...

-HOLOGRAMS: IDENTICAL -BAR CODES: IDS SCAN
-UV: 
YES -Passports FAKE IDS WITH FAST SHIPPING - EMAIL SUPPORT Fake ID's Over state drivers license cards and State ID cards available. Includes state driver's license hologram and magnetic strip or bar code on back. 2 business day shipping order (shipping and handling). The BEST authentic fake ID's on the web. Same quality, high resolution that Department of Motor Vehicles use. Send current .JPG or .GIF of current license with picture and changes in NAME, DOB, #LICENSE, RESTRICTIONS, etc. we produce the best fake ID online we sell UK/EU fake ID, Canadian fake ID, Australian fake ID and fake IDs for many other countries from fake passports to fake driving licenses to fake bank statements we have your identification needs covered. Our fake IDs include all security features such as genuine holograms, ultraviolet watermarks, intaglio printing, special paper, fluorescent dyes, RFID chips, bar codes corresponding to your details and more. Our fake IDs are identical to the real thing no other site will offer you this quality we are the best. new identity protect your privacy and take back your freedom..

Contact e-mails:=========== legitdocuments120@gmail.com
Thiago Barbosa 1Thiago Barbosa 1
Good Night! My name is Thiago. I have a question. 

 
@isTest 
global class AprovacaoGestaoPagamentosTest{
    
    
    @isTest static void getGestor() {

        Test.startTest();
          
       		AprovacaoGestaoPagamentos.getGestor();
        
        Test.stopTest();
        
    }
    
    @isTest static void getStatus(){
        
        Id caseId;

        Test.startTest();
          
       		AprovacaoGestaoPagamentos.getStatus(caseId);
        
        Test.stopTest();
        
    }
      
    @isTest static void caseAprovacao(){
        
       // Id caseId;
        Case iCase = new Case();
        //iCase.AccountId = caseId;
        //iCase.AssetId = caseId;
       
        
        Test.setMock(HttpCalloutMock.class, new AprovacaoGestaoPagamentosMockCallout(iCase));
          
        Test.startTest();

            insert iCase;
             
            Case lCasoAprova = AprovacaoGestaoPagamentos.caseAprovacao(iCase.Id);

        Test.stopTest();
        
        //System.assertEquals(lCasoAprova.Id, '8693dhb79870');
  
        //system.assert(lCasoAprova.AccountId == '8693dhb79870');
      
    }
    
	
    @isTest static void caseReprovacao(){
        
        Id caseId;
      
        Case iCase = new Case();

        insert iCase;
          
        Test.startTest();
        
            AprovacaoGestaoPagamentos.caseReprovacao(iCase.Id);

        Test.stopTest();

    }
    
    @isTest static void caseAguardarAprov(){
        
        Id caseId;
      
        Case iCase = new Case();

        insert iCase;
          
        Test.startTest();
        
            AprovacaoGestaoPagamentos.caseAguardarAprov(iCase.Id);

        Test.stopTest();

    }
    
    @isTest static void caseAguardarDoc(){
        
     
          
        Test.startTest(); 
           Id caseId;
        Case caseEdit;
        Case iCase = new Case();
        insert iCase;   
            AprovacaoGestaoPagamentos.caseAguardarDoc(iCase.Id);
        Test.stopTest();

    }
    
 
    
    
  
}
 
public without sharing class AprovacaoGestaoPagamentos {
    
    @AuraEnabled
    public static boolean getGestor(){
       
        Id idUser = UserInfo.getUserId();
        
        List<PermissionSetAssignment> lstPermission = [SELECT Id, PermissionSet.Name, AssigneeId FROM PermissionSetAssignment where PermissionSet.Name = 'Gestao_de_Pagamentos'AND AssigneeId =: idUser];
        //if(!lstPermission.isEmpty()) return true;
        //return false;
        return !lstPermission.isEmpty();
    }
    
    @AuraEnabled
    public static boolean getStatus(Id caseId){
        List<Case> solicitac = [Select id, Status_SGP__c From Case Where id = :caseId And (Status_SGP__c = 'Aprovado SGP' or Status_SGP__c = 'Reprovado SGP' or Status_SGP__c = 'Aguardando Aprovação' or Status_SGP__c = 'Aguardando Documentação')];
        return !solicitac.isEmpty();
    }
    
    @AuraEnabled
    public static Case caseAprovacao(Id caseId){
        
        List<Case> lstCase = new List<Case>(); 
      
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        //caseEdit.Aprovado_Gestao_Pagamentos__c = true;
        caseEdit.Status_SGP__c = 'Aprovado SGP';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false); 
        
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
                 for( Database.Error erro : result.getErrors()){
                    System.debug(erro.getMessage());
                }    
               return null;   
            
        }
        
        return caseEdit;// line with error
    }
    
    @AuraEnabled
    public static Case caseReprovacao(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Reprovado SGP';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
    @AuraEnabled
    public static Case caseAguardarAprov(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Aguardando Aprovação';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
    @AuraEnabled
    public static Case caseAguardarDoc(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Aguardando Documentação';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
}

User-added image
The code don't convering a line(return caseEdit) I try already diferents forms on the method @isTest static void caseAprovacao(). Have I to declare caseEdit as object on the class AprovacaoGestaoPagamentosTest ?What's the solution on the line for insert in the class AprovacaoGestaoPagamentos on the caseAprovacao ()method? Observation: The class AprovacaoGestaoPagamentos is correct. The class with error is AprovacaoGestaoPagamentos on the method caseAprovacao(). This missing to insert caseEdit as object and put on the consult SOQL.
 
Thiago Barbosa 1Thiago Barbosa 1
Good Night! My name is Thiago. I have a question. 
The code don't convering a line(return caseEdit) I try already diferents forms on the method @isTest static void caseAprovacao(). Have I to declare caseEdit as object on the class AprovacaoGestaoPagamentosTest ?What's the solution on the line for insert in the class AprovacaoGestaoPagamentos on the caseAprovacao ()method? Observation: The class AprovacaoGestaoPagamentos is correct. The class with error is AprovacaoGestaoPagamentos on the method caseAprovacao(). This missing to insert caseEdit as object and put on the consult SOQL.
@isTest 
global class AprovacaoGestaoPagamentosTest{
    
    
    @isTest static void getGestor() {

        Test.startTest();
          
       		AprovacaoGestaoPagamentos.getGestor();
        
        Test.stopTest();
        
    }
    
    @isTest static void getStatus(){
        
        Id caseId;

        Test.startTest();
          
       		AprovacaoGestaoPagamentos.getStatus(caseId);
        
        Test.stopTest();
        
    }
      
    <b>@isTest static void caseAprovacao(){
        
       // Id caseId;
        Case iCase = new Case();
        //iCase.AccountId = caseId;
        //iCase.AssetId = caseId;
       
        
        Test.setMock(HttpCalloutMock.class, new AprovacaoGestaoPagamentosMockCallout(iCase));
          
        Test.startTest();

            insert iCase;
             
            Case lCasoAprova = AprovacaoGestaoPagamentos.caseAprovacao(iCase.Id);

        Test.stopTest();
        
        //System.assertEquals(lCasoAprova.Id, '8693dhb79870');
  
        //system.assert(lCasoAprova.AccountId == '8693dhb79870');
      
    }</b>
    
	
    @isTest static void caseReprovacao(){
        
        Id caseId;
      
        Case iCase = new Case();

        insert iCase;
          
        Test.startTest();
        
            AprovacaoGestaoPagamentos.caseReprovacao(iCase.Id);

        Test.stopTest();

    }
    
    @isTest static void caseAguardarAprov(){
        
        Id caseId;
      
        Case iCase = new Case();

        insert iCase;
          
        Test.startTest();
        
            AprovacaoGestaoPagamentos.caseAguardarAprov(iCase.Id);

        Test.stopTest();

    }
    
    @isTest static void caseAguardarDoc(){
        
     
          
        Test.startTest(); 
           Id caseId;
        Case caseEdit;
        Case iCase = new Case();
        insert iCase;   
            AprovacaoGestaoPagamentos.caseAguardarDoc(iCase.Id);
        Test.stopTest();

    }
    
 
    
    
  
}
 
public without sharing class AprovacaoGestaoPagamentos {
    
    @AuraEnabled
    public static boolean getGestor(){
       
        Id idUser = UserInfo.getUserId();
        
        List<PermissionSetAssignment> lstPermission = [SELECT Id, PermissionSet.Name, AssigneeId FROM PermissionSetAssignment where PermissionSet.Name = 'Gestao_de_Pagamentos'AND AssigneeId =: idUser];
        //if(!lstPermission.isEmpty()) return true;
        //return false;
        return !lstPermission.isEmpty();
    }
    
    @AuraEnabled
    public static boolean getStatus(Id caseId){
        List<Case> solicitac = [Select id, Status_SGP__c From Case Where id = :caseId And (Status_SGP__c = 'Aprovado SGP' or Status_SGP__c = 'Reprovado SGP' or Status_SGP__c = 'Aguardando Aprovação' or Status_SGP__c = 'Aguardando Documentação')];
        return !solicitac.isEmpty();
    }
    
    @AuraEnabled
    public static Case caseAprovacao(Id caseId){
        
        List<Case> lstCase = new List<Case>(); 
      
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        //caseEdit.Aprovado_Gestao_Pagamentos__c = true;
        caseEdit.Status_SGP__c = 'Aprovado SGP';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false); 
        
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
                 for( Database.Error erro : result.getErrors()){
                    System.debug(erro.getMessage());
                }    
               return null;   
            
        }
        
      <b>  return caseEdit;// line with error</b>
    }
    
    @AuraEnabled
    public static Case caseReprovacao(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Reprovado SGP';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
    @AuraEnabled
    public static Case caseAguardarAprov(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Aguardando Aprovação';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
    @AuraEnabled
    public static Case caseAguardarDoc(Id caseId){
        List<Case> lstCase = new List<Case>(); 
        Case caseEdit = [Select id, Status_SGP__c from Case where id=:caseId];
        caseEdit.Status_SGP__c = 'Aguardando Documentação';
        
        lstCase.add(caseEdit);
        
        List<Database.UpsertResult> lstResult = Database.upsert(lstCase, false);
        for(Database.UpsertResult result : lstResult){
            if(!result.isSuccess()){
               return null;   
            }
        }

        return caseEdit;
    }
    
}



AprovacaoGest