• originalang
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
How can I check whether a file has been uploaded through the 'File upload lightning component' that is used in a Visual Flow. My goal is to display a success page if the file is uploaded, and display an error if no file is provided.

Any help with this is greatly appreciated!
  Set<id> resultId = new Set<id>();

I need to send the resultId to another apex controller , so that i can use that in where ID IN condition
hi All,
    can you help me out with my test class.
public class BatchAccountActivationDate implements Database.Batchable<sObject>, Database.Stateful {
    public static void run( Set<Id> AccountIds ) {
        
        List<Account> accountRecords = [ SELECT Id, Name, Activation_Date__c, Expiration_Date__c,
                                        ( SELECT Id, Name, StageName, Type, Contract_Expiration_Date__c, Account.Activation_Date__c, 
                                         Account.Expiration_Date__c, Contract_Activation_Date__c  
                                         FROM Opportunities 
                                         WHERE StageName = 'Closed Won' 
                                         AND ( Type= 'New Bus' OR Type= 'Expand' OR Type= 'Renewal' ) 
                                         ORDER BY createdDate DESC
                                        )
                                        FROM Account 
                                        WHERE Id IN: AccountIds 
                                       ];
        executeHelper( accountRecords );                  
    }
    
    
    
    
    public Database.QueryLocator start( Database.BatchableContext bc ){
        String stgName = 'Closed Won';
        Set<String> oppType = new Set<String>{ 'New Bus', 'Expand', 'Renewal' };
            
            String query=' SELECT Id, Name, Activation_Date__c, Expiration_Date__c,' +
            ' ( SELECT Id, Name, StageName, Type, Contract_Expiration_Date__c, Contract_Activation_Date__c '+
            ' FROM Opportunities WHERE StageName =:'+ stgName +
            ' AND Type IN :'+oppType +
            ') '+
            ' FROM Account';
        
        
        return Database.getQueryLocator( query );
    }
    public void execute( Database.BatchableContext bc, List<Account> accounts ){
        executeHelper( accounts );
    }
    
    
    public void finish(Database.BatchableContext bc){
        
    }
    
    public static void executeHelper( List<Account> accountRecords ){
        System.debug('***** accountRecords : '+accountRecords );
        List<Account> accToUpdate= new List<Account>();
        
        for( Account acc : accountRecords ){
            System.debug('**** accountRecords.Opps : ' +acc.opportunities );
            
            Opportunity opp = acc.opportunities.get(0);
            opp.Account.Activation_Date__c = opp.Contract_Activation_Date__c;
            opp.Account.Expiration_Date__c = opp.Contract_Expiration_Date__c;
            
            System.debug('**** opp.Account.Activation_Date__c : ' +opp.Account.Activation_Date__c );
            System.debug('**** opp.Account.Expiration_Date__c : ' +opp.Account.Expiration_Date__c );
            accToUpdate.add(opp.Account);
            
        }
        
        
        
        if(accToUpdate.size() > 0)
        {
            update accToUpdate;
        }
        
        
    }
}     this is my batch class. and can anyone help me to write its test class