• rahul Shukla 37
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 9
    Replies
How to Logged all Email sent through salesforce on Activity timeline
Please help me to acheive this Scenario
If Response Time > Expected Time - 10 mins: Yellow I just wants to convert this in Formula as per GST Time
I have two record types on account object (household and organisation) once we convert the lead it's creates two accounts but both have same record type household only I want one will be household and another one will be organisation.

Please help me to achieve this scenario
I am getting the Null pointer error while keeping Lat invoice generated field blank.
Below is my code:
public class OpportunityTriggerEventHelper {
    
    public static void updateBaseRateOnOpp(Map<Id, Opportunity> oldDRObjMap, List<Opportunity> newDRObjList) {
        //if(checkRecursive.runOnce()){
            
            set<string> frequency = new set<string>();
            set<string> category = new set<String>();
            Set<Id> oppId = new Set<Id>();
            Map<string,Daily_Rate__c> maprate = new Map<string,Daily_Rate__c>(); 
            
            for(Opportunity d : newDRObjList){
                
                if(oldDRObjMap != null && oldDRObjMap.get(d.Id).cfg_LastInvGenDate__c !=d.cfg_LastInvGenDate__c) {
                    category.add(d.cfg_ChildAgeCat__c);
                    
                        oppId.add(d.Id);
                    }
                     }
            
            for(Opportunity opp : [SELECT Id, cfg_Enrollment__r.cfg_Attendance_Frequency__c FROM Opportunity WHERE ID IN :oppId]){
                frequency.add(opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c);
            }
          
            list<Opportunity> oppLst = new list<Opportunity>();
            
            for(Opportunity opp : [SELECT Id, cfg_Enrollment__r.cfg_Attendance_Frequency__c, cfg_ChildAgeCat__c, cfg_LastInvGenDate__c FROM Opportunity WHERE ID IN :oppId]){
                
                for(Daily_Rate__c drObj : [SELECT Id, Attendance_frequency__c, Child_Category__c, Rate__c, Start_Date__c, End_Date__c 
                                           FROM Daily_Rate__c 
                                           WHERE Attendance_frequency__c = :opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c AND Child_Category__c = :opp.cfg_ChildAgeCat__c
                                           AND Start_Date__c <= :opp.cfg_LastInvGenDate__c.addDays(7) AND End_Date__c >= :opp.cfg_LastInvGenDate__c.addDays(7)]){
                                               maprate.put(drObj.Attendance_frequency__c +''+drObj.Child_Category__c, drObj);   
                                           }
            }
            
            
            for(Opportunity opp : [SELECT Id, cfg_Enrollment__r.cfg_Attendance_Frequency__c, cfg_ChildAgeCat__c, cfg_LastInvGenDate__c FROM Opportunity WHERE ID IN :oppId]){
                if(maprate.containsKey(opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c +''+ opp.cfg_ChildAgeCat__c)){
                    
                    if(maprate.get(opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c +''+ opp.cfg_ChildAgeCat__c).Start_Date__c <= opp.cfg_LastInvGenDate__c.addDays(7) && maprate.get(opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c +''+ opp.cfg_ChildAgeCat__c).End_Date__c >= opp.cfg_LastInvGenDate__c.addDays(7))
                        
                        opp.Base_Rate__c = maprate.get(opp.cfg_Enrollment__r.cfg_Attendance_Frequency__c +''+ opp.cfg_ChildAgeCat__c).Rate__c;
                       
                     
                        }
                oppLst.add(opp);
            }
            
            if(!oppLst.isEmpty()){
                update oppLst;    
            }
            
        //}
    }
}
public class cfg_LeadUtility {
     @InvocableMethod(label='Convert the Lead' description='Convert the lead by LeadId and returns True/False as success/failures' category='Lead')
    public static List<String> ConvertLead(List<ID> leadIds) {
        List<String> convertedLeads= new List<String>();
        LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
        for (String leadId: leadIds) {
            Database.LeadConvert lc = new Database.LeadConvert();
            lc.setLeadId(leadId);
            lc.setConvertedStatus(convertStatus.MasterLabel);   
                    
            Database.LeadConvertResult lcr ;
            try{
                lcr = Database.convertLead(lc);
                system.debug('*****lcr.isSuccess()'+lcr.isSuccess());            
                convertedLeads.add(LeadId);
            }
            catch(exception ex){
                system.debug('***LEAD NOT CONVERTED**');           
            }
        }
        
        return convertedLeads;
    }   
}
i wants to test this class as per below Test class but not covering the code please anyone help me to find the issue in Test class
@isTest  
private class cfg_LeadUtilityTest {  
      
    static testMethod void testLeadConv() {  
          
        //Lead objLead = new Lead( FirstName = 'Test', LastName = 'Sample', Company = 'Testing Sample Co' );  
        Lead objLead = utilityHelperTest.createLead();
        insert objLead;  
          
        Database.LeadConvert lc = new database.LeadConvert();  
        lc.setLeadId( objLead.Id );  
        //lc.setDoNotCreateOpportunity( true );  
        lc.setConvertedStatus( 'Closed - Converted' );  
          
        Database.LeadConvertResult lcr = Database.convertLead(lc, false);  
          
        system.debug( 'Errors are ' + lcr.getErrors() );  
          
        system.assert( lcr.isSuccess() );  
          
    }  
  
}
 
Hi All,

I have one custom object daily rates, in which i am having one field rates and one picklist field is category(which include infant toddler and 3+), another object i have contact which also have three checkbox field (infant, toddler and 3+), if any of checkbox become true on contact, then i want to update base_rate field on opportunity and rate should fetch from the daily rate object, that i already set based on category (infant,toddler and 3+).
Please help me how can i achieve this scenerio.  
I wants to put filter on calendar,I have one custom field center_location(Picklist) on the basis of center location wants to put the filter on calendar so that once i select the any center_location calendar will show those meetings only. 
can anyone help me to achieve it.
I have multi select picklist in which I want values in available box should be default present in chosen box please help me to achieve this scenario.
Hi Everyone,
Please help me to achieve scenario 
when i will change the opportunity stage to confirm then i need one pop up the will show 2 button confirm and cancel.

 
I have one custom object in which two field is available available start date and previous enroll if previous enroll is not null then Available start date will be read only if null then it should be editable please help me to achieve this scenario
How write a trigger for opportunity stage cannot be move backward like if set 'qualification' not move to previous stage 'Prospecting'
Please help me on this question of SOQL
Find the account Specific account and check the number of contact associated with that account if the count of contact is odd add one more and make it even
I have multi select picklist in which I want values in available box should be default present in chosen box please help me to achieve this scenario.
Hi Everyone,
Please help me to achieve scenario 
when i will change the opportunity stage to confirm then i need one pop up the will show 2 button confirm and cancel.

 
How write a trigger for opportunity stage cannot be move backward like if set 'qualification' not move to previous stage 'Prospecting'
I am preparing for salesforce developer I certification and ran into a question:
 
A Developer wants to create a custom object to track Customer Invoices.
How should Invoices and Accounts be related to relate that all invoices are visible to everyone with access to the Account?
Of course it’s going to be a master detail relationship
There are two options:
The Invoice should have master detail relationship to the Account
 The Account should have master detail relationship to the Invoice.I want to know what is the difference between the two. They both look similar.
Can someone please help