• Geetu
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 17
    Replies
Hi I have HTML email template which i want to convert to German language. I can see that we can convert VF email templates but how do i convert HTML email templates. 

Any pointers. 
Thanks 
Geetu
  • June 20, 2019
  • Like
  • 0
Hi, need help in creating report - 

I have one lookup relationship fields on the Contract object. One for lookup to Account, And now i have lookup to a Account called Custom object (employess)

I want to be able to report on Accounts, Account without Contract for Active employee (Status field on Employee object = Active)

Any idea how i can create this report.

All help appreciated.
  • June 11, 2019
  • Like
  • 0
hi i need a help, i have a user who has salesforce license and profile standard user . I have a permission set - say ABC which i have assigned to this user. 

I want to hide New Report and New Report(classic) for this permission set. I have disabled all the system properties related to report but still when i logged in as above user he can see New report and New report (classic) . Any idea how can i remove Ne wreport and New report classic using permission set. 
thanks 
 
  • June 05, 2019
  • Like
  • 0
hi i am doing trailhead challenge "configure quote templates and quotes" and i am getting below error. 
I have chcked i have status as "In Review" and date as 3/31/2017 but i am not able to rename Quote name as " 'Diesel Generator and Installation for Edge', as this is auto number field. Any suggestion on how to rename Quote Name 
Could not find a Quote for the 'Edge Installation' opportunity with the name 'Diesel Generator and Installation for Edge', a status of 'In Review' and an expiration date of '3/31/2017'.
  • May 17, 2019
  • Like
  • 0
hi Guys,

I need help in below scenario - 
we hav a installed app and sales app. We have our own profiles for custom app and sales app has thier own profiles. In futire we might  have users who are common to both the apps and have sales app profile. We need to give access to both the apps. How do we design this and make sure they have access to all our objects and our functioanlity (installed app).We are thinking of having permission set and assign those permission sets to common users so that they can have thier own sales app profiles plus have access to our installed app objects and finctiaonlity. 

Kidly share your ideas. 
Thanks,
  • May 13, 2019
  • Like
  • 0
Hi All, 

Need a help 

I have  a junction object C with A and B as master detail relationship. We have a trigger to insert record into C object when ever a record is inserted into B for A records.
My requiement is to copy a value(city from B object) from B object to C object . And then i am using this city for some conditional logic.  I need help in designing this, i can create a new field at C object(CITY) and then i can copy the value from B to C in existing trigger. But when i need to use this City field in conditional logic on A object, how do i do this. Hope i have complicated my requirement.

thansk in advance. 
  • May 09, 2019
  • Like
  • 0
Hi I am getting error  - Could not find a user's successful login using two-factor authentication. Make sure you successfully login at least once and that you are prompted for a second factor of authentication.

i have done all the reuqired steps. Please help me how to clear this.
  • January 19, 2019
  • Like
  • 0
hi i need to write a matching rule for agreement object, i need to include customer name, contrac tyear,total agreement value. 

I am able to add all excet total agreement value, as this field is not visible under matching criteria. Any lead why it is not showing up. 
  • January 08, 2019
  • Like
  • 0
When we are trying to deply report from one sandbox to another  , we are getting error 
Cannot find a user that matches any of the following usernames: xyz.abc@company.com.changesetcreationsandbox, xyz.abc@company.com.changesetdeploymentsandbox; remove the user from the component being deployed or create a matching user in the destination organization.

I have gone through couple of linkes , but i am not able to deply as i dont see option a srunning user. I see below options - 
View dashboard as  - 
Me
Another person
Let dashboard viewers choose whom they view the dashboard as Dashboard viewer

Please let me know which option i have to select while deploying in next higher sandobx where my login id doesnt exits and person deploying the reports/dashboards is different than me 
 
  • January 07, 2019
  • Like
  • 0
we have cycle time enabled for our agreement, and we can see Duration (hours) as out of box field avaialble at report which denotes the duration for any agreement from one stage to another ( its same as stage for opportuntiy). 
Our requirement is to have duration in days. 
Any leads how we can do this. 
 
  • January 07, 2019
  • Like
  • 0
Can somebody pls help me to write test class : 


global class SendEmailNotification30days_CLM implements Database.Batchable < sObject >, Schedulable, Database.Stateful
{
    global List<String> errorMessages = new List<String>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
         System.debug(Date.today().addDays(30));
         Date todaysdt = Date.today(); 
         Date ed = Date.today().addDays(30);
         System.debug(Date.today().addDays(30));
         // This set will hold the Id's of the docu sign receipient status
         Set <ID> DocusignId = new Set <ID>(); 
        
         // Query all the docu sign receipient status in your database that meet the selection criterial for update.
         // Return this list of docu sign receipient status, which will get passed to our execute() method below.
         Date past30Date = Date.today().addDays(-30);
         system.debug('===past30Date==='+past30Date);
         return Database.getQueryLocator('Select  ID, Name,Customer_Flag_CLM__c,Customer_Signed_Date_CLM__c,User_Flag_CLM__c,Apttus_DocuApi__DocuSignEnvelopeId__c FROM Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c  WHERE Customer_Signed_Date_CLM__c =: past30Date and User_Flag_CLM__c = false');
}
    
    
global void execute(Database.BatchableContext bc, List < Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c > recs) 
{
        system.debug('===recs==='+recs);
        Map<Id,Id> envelopeAgreementMap = new Map<Id,Id>();
        Set<Id> envIdSet = new set<Id>();
        Set<Id> agrementIdSet = new set<Id>();
        Set<Id> appSet = new Set<Id>();
        for(Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c status : recs)
        {
            envIdSet.add(status.Apttus_DocuApi__DocuSignEnvelopeId__c);
        }
        List<Apttus_DocuApi__DocuSignEnvelope__c> DocuSignEnvelopeList =
                [SELECT Id,
                        Apttus_CMDSign__Agreement__r.Id
                 FROM Apttus_DocuApi__DocuSignEnvelope__c WHERE Id IN :envIdSet
                 ];
        for(Apttus_DocuApi__DocuSignEnvelope__c env : DocuSignEnvelopeList)
        {
            agrementIdSet.add(env.Apttus_CMDSign__Agreement__r.Id);
        }
        set<Id> agreementSet = new set<Id>();
        Set<String> ownerIds= new Set<String>();
        Set<String> ManagerName= new Set<String>();
        Map<Id,string> AgreeOwnerMap = new Map<Id,string>();
        Map<Id,string> AgreeManagerMap = new Map<Id,string>();
        List<Apttus__APTS_Agreement__c> agrList = new List<Apttus__APTS_Agreement__c>();
        for(Apttus__APTS_Agreement__c agreement : [SELECT Id,OwnerId,Owner.Name,Name,Manager_Full_Name_CLM__c
                                                   FROM Apttus__APTS_Agreement__c WHERE Id IN :agrementIdSet])
        {
            System.debug('Hello');                                           
            agreementSet.add(agreement.Id);
            agrList.add(agreement);
            ownerIds.add(agreement.OwnerId);    
            AgreeOwnerMap.put(agreement.Id,agreement.OwnerId);          
        }
    Map<Id,Id> OwnerManagerIdMap =new map<Id,Id>();
    Map<Id,User> OwnerDetailMap =new map<Id,User>();
    Set<Id> allUserIds = new Set<Id>();
            for(User userObj : [SELECT Id,Name,ManagerId,Manager.ManagerId,Manager.Manager.ManagerId,Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.Manager.Manager.ManagerId FROM User WHERE Id IN :ownerIds])
             {
                 OwnerDetailMap.put(userObj.Id, userObj);
               OwnerManagerIdMap.put(userObj.Id,userObj.ManagerId);
                 allUserIds.add(userObj.ManagerId);
                 allUserIds.add(userObj.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.Manager.Manager.ManagerId);
             }
            Map<Id,User> managerUserDetailMap = new Map<Id,User>([Select id,Name,Email,IsActive,Approval_Limit__c,Comp_Class__c from User where id in : allUserIds]);

            EmailTemplate empID = [SELECT Id,Name,HTMLValue,Body,Subject FROM EmailTemplate WHERE Name =: 'Test_Template' Limit 1];
            
            //send single emails to these contacts
            List < Messaging.SingleEmailMessage > mailList = new List < Messaging.SingleEmailMessage > (); 
            List<String> toAddresses = new List < String > ();
   
            for (Apttus__APTS_Agreement__c agr : agrList)
            {
                   
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                 
                    
                Id manager1Id = OwnerManagerIdMap.get(agr.ownerId);
                Id manager2Id = OwnerDetailMap.get(agr.ownerId).Manager.ManagerId;
                Id manager3Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.ManagerId;
                Id manager4Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.ManagerId;
                Id manager5Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.ManagerId;
                Id manager6Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.Manager.ManagerId;
                Id manager7Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.Manager.Manager.ManagerId;
                
               String emailStr = '';
               String ManagerFullName = '';
                if(managerUserDetailMap.get(manager1Id) != null && managerUserDetailMap.get(manager1Id).isActive){
                    emailStr = managerUserDetailMap.get(manager1Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager1Id).Name;
                }else if(managerUserDetailMap.get(manager2Id) != null && managerUserDetailMap.get(manager2Id).isActive){
                    emailStr = managerUserDetailMap.get(manager2Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager2Id).Name;
                }else if(managerUserDetailMap.get(manager3Id) != null && managerUserDetailMap.get(manager3Id).isActive){
                    emailStr = managerUserDetailMap.get(manager3Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager3Id).Name;
                }else if(managerUserDetailMap.get(manager4Id) != null && managerUserDetailMap.get(manager4Id).isActive){
                    emailStr = managerUserDetailMap.get(manager4Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager4Id).Name;
                }else if(managerUserDetailMap.get(manager5Id) != null && managerUserDetailMap.get(manager5Id).isActive){
                    emailStr = managerUserDetailMap.get(manager5Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager5Id).Name;
                }else if(managerUserDetailMap.get(manager6Id) != null && managerUserDetailMap.get(manager6Id).isActive){
                    emailStr = managerUserDetailMap.get(manager6Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager6Id).Name;
                }else if(managerUserDetailMap.get(manager7Id) != null && managerUserDetailMap.get(manager7Id).isActive){
                    emailStr = managerUserDetailMap.get(manager7Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager7Id).Name;
                }
                toAddresses.add(emailStr);
                    mail.setToAddresses(toAddresses);
                    mail.setTemplateId(empID.Id);
                    mail.setWhatId(agr.Id); 
                    String hSubject = empID.Subject;
                    hSubject = hSubject.replace('{!Apttus__APTS_Agreement__c.Name}', agr.Name);     
                    mail.setSubject(hSubject);
                    mail.setBccSender(false);
                    mail.setUseSignature(false);                
                    String hBody = empID.Body;
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.Name}', agr.Name);
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.CreatedBy}', agr.Owner.Name);
                   // hBody = hBody.replace('{!Apt3tus__APTS_Agreement__c.OwnerFullName}', agr.Owner.Name);
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.Manager_Full_Name_CLM__c}', ManagerFullName);
                    mail.setPlainTextBody(hBody);
                    mailList.add(mail);
                    toAddresses.clear();
                }
             Messaging.sendEmail(mailList);
       
}

    global void finish(Database.BatchableContext bc)
{
        
}
    
    global void execute(SchedulableContext SC) 
{
        SendEmailNotification30Days_CLM batchable = new SendEmailNotification30days_CLM();
        database.executebatch(batchable);
}
}
  • December 10, 2018
  • Like
  • 0
Hi I need help in creating trigger - 
I have agreement object under which activity history tab is there. So, when ever a agreement is singed via docusign a activity is pushed into salesforce Activity history, having subject as 
Agreement E-signed By <Agreement Signername > @timestamp (e.g. @2018-11-19T22:57:35 GMT)

so i have a requirement to find out if this agreement is singed by customer or by Agreement sender. 
Our approach is to have trigger on actviity history, when ever therr is a record insertion we need to check 
if subject contains " E-signed" then we need to take values after BY and before @ to capture who has singed it. And then search in salesforce user, if this user exits. If yes, then mark a custom flag on agreemnt object "USER_FLG_SIGN" to Y if not then make "CUSTOMER_FLG" on agreemtn object to Y. 
how can i do this with Trigger , or please provide suggestions.
  • November 21, 2018
  • Like
  • 0
how to cover public Sender Sender { get; set; } in test class  where sender is described as below 

public class Sender
{
    public string ServiceName { get; set; }
    public string SenderID { get; set; }
}

thanks in advance for help. 
  • November 13, 2018
  • Like
  • 0
hi , i have a apex class which has
 String recordTypeId = inputParameters.get('recordTypeId');
String accountId=inputParameters.get('accountId'); 

i nee dto have another input date, how can i take todays date as an input? 

thanks in advance for help. 
  • November 08, 2018
  • Like
  • 0
can somebody help me how to write test class for below class

global class WizardCallBack_CLM implements Apttus.WizardCustomClass.IDataSourceCallback{
      
      /*
        Description :- Accepts Account Id,Record Type Id,Parent Id and Account Name to autopopulate as parameter and sends the JSON response to be used in Wizard
        Input :- Wizard ID, Map of parameters passed in URL
        Output :- JSON response using class WizardCallbackResponse_CLM
      */
      global String getData(String wizardId,Map<String,String> inputParameters){
          String accountId=inputParameters.get('accountId');
          String recordTypeId = inputParameters.get('recordTypeId');
          String accountName=inputParameters.get('accountName');
          String parentId = inputParameters.get('parentId');
          String oemNames = inputParameters.get('oemNames').replace(';,',';');
          System.debug('>>>>>>>> accountName '+accountName);
          System.debug('>>>>>>>> parentId '+parentId);
          
          WizardCallbackResponse_CLM.WizardCallbackData data = new WizardCallbackResponse_CLM.WizardCallbackData();
          
          List<Apttus__WizardInputControl2__c> inputControlsList = [SELECT Apttus__Question__c,Apttus__WizardStepId__c FROM Apttus__WizardInputControl2__c where Apttus__WizardStepId__c in (SELECT id FROM Apttus__WizardStep2__c where Apttus__WizardDesignId__c =: Label.CPG)];
          
          List<WizardCallbackResponse_CLM.UserResponses> userResponseList= new List<WizardCallbackResponse_CLM.UserResponses>();
          System.debug('>>>>>>>>List'+inputControlsList);
          for(Apttus__WizardInputControl2__c inputObj :inputControlsList){
             System.debug('>>>>>>>>question'+inputObj.Apttus__Question__c);
             if(accountName!=null && inputObj.Apttus__Question__c == 'What is the legal name of the dealer?')
             {
                 System.debug('>>>>>>Inside If');
                 WizardCallbackResponse_CLM.UserResponses userResponse = new WizardCallbackResponse_CLM.UserResponses();
                 userResponse.Question = 'What is the company name?';
                 userResponse.inputRepeatSequence = 0;
                 userResponse.inputControlId = inputObj.id;
                 userResponse.Answer=accountName;
                 userResponseList.add(userResponse);
             }
             
             }
          }
                          
                  
          data.UserResponses = userResponseList;
          data.Parameters = null;    
          return JSON.serialize(data);
    }   
}
 
  • November 06, 2018
  • Like
  • 0
Hi, I have a custom setting "XYZ" and Name . I want to write a test class for retriving value of URLLink for custom settin "XYZ" . 
I have written my test class, and have properly inserted values for custom setting and URLLink but still i am getting " 
System.NullPointerException: Attempt to de-reference a null object.
can somebody pls help 


@AuraEnabled
    public static string GetCustomsettingValueName()
    {
        
        Object_Name Obj= Object_Name.getValues('XYZ settin'); 
        return Obj.URLLink;
    }

Testclass : 

 Custom_obj CDH = new Custom_obj();
         Custom_ob.Name = 'Test Custom settinges';
        CDH.URLLink='http://www.Test';
        insert CDH;
  • November 01, 2018
  • Like
  • 0
can somebody pls help me to write test class for below code in apex class
//Get RecordTypes name from Account Object
    @AuraEnabled
    public static string findRecordTypes(string objName){
        string returnString='';
        string queryString='Select id,name from RecordType where sobjectType =: objName  
       
        List<sobject> recordList= Database.query(queryString);
        List<RecordTypeWrapper> wrapperList=new List<RecordTypeWrapper>();
        for(sobject sb : recordList)  {
            RecordTypeWrapper rw=new RecordTypeWrapper();
            rw.recordTypeLabel=string.valueof(sb.get('name'));
            rw.recordTypeId=string.valueof(sb.get('id'));
            wrapperList.add(rw);
        }
        returnString= JSON.serialize(wrapperList);
       
        return returnString;
    }
 
 
  • October 31, 2018
  • Like
  • 0
We need to prevent password protected document(agreement) to be uploaded in sales force. Can some body give pointers how can i achieve this.
  • October 19, 2018
  • Like
  • 0
hi i am doing trailhead challenge "configure quote templates and quotes" and i am getting below error. 
I have chcked i have status as "In Review" and date as 3/31/2017 but i am not able to rename Quote name as " 'Diesel Generator and Installation for Edge', as this is auto number field. Any suggestion on how to rename Quote Name 
Could not find a Quote for the 'Edge Installation' opportunity with the name 'Diesel Generator and Installation for Edge', a status of 'In Review' and an expiration date of '3/31/2017'.
  • May 17, 2019
  • Like
  • 0
hi Guys,

I need help in below scenario - 
we hav a installed app and sales app. We have our own profiles for custom app and sales app has thier own profiles. In futire we might  have users who are common to both the apps and have sales app profile. We need to give access to both the apps. How do we design this and make sure they have access to all our objects and our functioanlity (installed app).We are thinking of having permission set and assign those permission sets to common users so that they can have thier own sales app profiles plus have access to our installed app objects and finctiaonlity. 

Kidly share your ideas. 
Thanks,
  • May 13, 2019
  • Like
  • 0
Hi All, 

Need a help 

I have  a junction object C with A and B as master detail relationship. We have a trigger to insert record into C object when ever a record is inserted into B for A records.
My requiement is to copy a value(city from B object) from B object to C object . And then i am using this city for some conditional logic.  I need help in designing this, i can create a new field at C object(CITY) and then i can copy the value from B to C in existing trigger. But when i need to use this City field in conditional logic on A object, how do i do this. Hope i have complicated my requirement.

thansk in advance. 
  • May 09, 2019
  • Like
  • 0
When we are trying to deply report from one sandbox to another  , we are getting error 
Cannot find a user that matches any of the following usernames: xyz.abc@company.com.changesetcreationsandbox, xyz.abc@company.com.changesetdeploymentsandbox; remove the user from the component being deployed or create a matching user in the destination organization.

I have gone through couple of linkes , but i am not able to deply as i dont see option a srunning user. I see below options - 
View dashboard as  - 
Me
Another person
Let dashboard viewers choose whom they view the dashboard as Dashboard viewer

Please let me know which option i have to select while deploying in next higher sandobx where my login id doesnt exits and person deploying the reports/dashboards is different than me 
 
  • January 07, 2019
  • Like
  • 0
Can somebody pls help me to write test class : 


global class SendEmailNotification30days_CLM implements Database.Batchable < sObject >, Schedulable, Database.Stateful
{
    global List<String> errorMessages = new List<String>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
         System.debug(Date.today().addDays(30));
         Date todaysdt = Date.today(); 
         Date ed = Date.today().addDays(30);
         System.debug(Date.today().addDays(30));
         // This set will hold the Id's of the docu sign receipient status
         Set <ID> DocusignId = new Set <ID>(); 
        
         // Query all the docu sign receipient status in your database that meet the selection criterial for update.
         // Return this list of docu sign receipient status, which will get passed to our execute() method below.
         Date past30Date = Date.today().addDays(-30);
         system.debug('===past30Date==='+past30Date);
         return Database.getQueryLocator('Select  ID, Name,Customer_Flag_CLM__c,Customer_Signed_Date_CLM__c,User_Flag_CLM__c,Apttus_DocuApi__DocuSignEnvelopeId__c FROM Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c  WHERE Customer_Signed_Date_CLM__c =: past30Date and User_Flag_CLM__c = false');
}
    
    
global void execute(Database.BatchableContext bc, List < Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c > recs) 
{
        system.debug('===recs==='+recs);
        Map<Id,Id> envelopeAgreementMap = new Map<Id,Id>();
        Set<Id> envIdSet = new set<Id>();
        Set<Id> agrementIdSet = new set<Id>();
        Set<Id> appSet = new Set<Id>();
        for(Apttus_DocuApi__DocuSignEnvelopeRecipientStatus__c status : recs)
        {
            envIdSet.add(status.Apttus_DocuApi__DocuSignEnvelopeId__c);
        }
        List<Apttus_DocuApi__DocuSignEnvelope__c> DocuSignEnvelopeList =
                [SELECT Id,
                        Apttus_CMDSign__Agreement__r.Id
                 FROM Apttus_DocuApi__DocuSignEnvelope__c WHERE Id IN :envIdSet
                 ];
        for(Apttus_DocuApi__DocuSignEnvelope__c env : DocuSignEnvelopeList)
        {
            agrementIdSet.add(env.Apttus_CMDSign__Agreement__r.Id);
        }
        set<Id> agreementSet = new set<Id>();
        Set<String> ownerIds= new Set<String>();
        Set<String> ManagerName= new Set<String>();
        Map<Id,string> AgreeOwnerMap = new Map<Id,string>();
        Map<Id,string> AgreeManagerMap = new Map<Id,string>();
        List<Apttus__APTS_Agreement__c> agrList = new List<Apttus__APTS_Agreement__c>();
        for(Apttus__APTS_Agreement__c agreement : [SELECT Id,OwnerId,Owner.Name,Name,Manager_Full_Name_CLM__c
                                                   FROM Apttus__APTS_Agreement__c WHERE Id IN :agrementIdSet])
        {
            System.debug('Hello');                                           
            agreementSet.add(agreement.Id);
            agrList.add(agreement);
            ownerIds.add(agreement.OwnerId);    
            AgreeOwnerMap.put(agreement.Id,agreement.OwnerId);          
        }
    Map<Id,Id> OwnerManagerIdMap =new map<Id,Id>();
    Map<Id,User> OwnerDetailMap =new map<Id,User>();
    Set<Id> allUserIds = new Set<Id>();
            for(User userObj : [SELECT Id,Name,ManagerId,Manager.ManagerId,Manager.Manager.ManagerId,Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.Manager.ManagerId,Manager.Manager.Manager.Manager.Manager.Manager.ManagerId FROM User WHERE Id IN :ownerIds])
             {
                 OwnerDetailMap.put(userObj.Id, userObj);
               OwnerManagerIdMap.put(userObj.Id,userObj.ManagerId);
                 allUserIds.add(userObj.ManagerId);
                 allUserIds.add(userObj.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.Manager.ManagerId);
                 allUserIds.add(userObj.Manager.Manager.Manager.Manager.Manager.Manager.ManagerId);
             }
            Map<Id,User> managerUserDetailMap = new Map<Id,User>([Select id,Name,Email,IsActive,Approval_Limit__c,Comp_Class__c from User where id in : allUserIds]);

            EmailTemplate empID = [SELECT Id,Name,HTMLValue,Body,Subject FROM EmailTemplate WHERE Name =: 'Test_Template' Limit 1];
            
            //send single emails to these contacts
            List < Messaging.SingleEmailMessage > mailList = new List < Messaging.SingleEmailMessage > (); 
            List<String> toAddresses = new List < String > ();
   
            for (Apttus__APTS_Agreement__c agr : agrList)
            {
                   
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                 
                    
                Id manager1Id = OwnerManagerIdMap.get(agr.ownerId);
                Id manager2Id = OwnerDetailMap.get(agr.ownerId).Manager.ManagerId;
                Id manager3Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.ManagerId;
                Id manager4Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.ManagerId;
                Id manager5Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.ManagerId;
                Id manager6Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.Manager.ManagerId;
                Id manager7Id = OwnerDetailMap.get(agr.ownerId).Manager.Manager.Manager.Manager.Manager.Manager.ManagerId;
                
               String emailStr = '';
               String ManagerFullName = '';
                if(managerUserDetailMap.get(manager1Id) != null && managerUserDetailMap.get(manager1Id).isActive){
                    emailStr = managerUserDetailMap.get(manager1Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager1Id).Name;
                }else if(managerUserDetailMap.get(manager2Id) != null && managerUserDetailMap.get(manager2Id).isActive){
                    emailStr = managerUserDetailMap.get(manager2Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager2Id).Name;
                }else if(managerUserDetailMap.get(manager3Id) != null && managerUserDetailMap.get(manager3Id).isActive){
                    emailStr = managerUserDetailMap.get(manager3Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager3Id).Name;
                }else if(managerUserDetailMap.get(manager4Id) != null && managerUserDetailMap.get(manager4Id).isActive){
                    emailStr = managerUserDetailMap.get(manager4Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager4Id).Name;
                }else if(managerUserDetailMap.get(manager5Id) != null && managerUserDetailMap.get(manager5Id).isActive){
                    emailStr = managerUserDetailMap.get(manager5Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager5Id).Name;
                }else if(managerUserDetailMap.get(manager6Id) != null && managerUserDetailMap.get(manager6Id).isActive){
                    emailStr = managerUserDetailMap.get(manager6Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager6Id).Name;
                }else if(managerUserDetailMap.get(manager7Id) != null && managerUserDetailMap.get(manager7Id).isActive){
                    emailStr = managerUserDetailMap.get(manager7Id).Email;
                    ManagerFullName = managerUserDetailMap.get(manager7Id).Name;
                }
                toAddresses.add(emailStr);
                    mail.setToAddresses(toAddresses);
                    mail.setTemplateId(empID.Id);
                    mail.setWhatId(agr.Id); 
                    String hSubject = empID.Subject;
                    hSubject = hSubject.replace('{!Apttus__APTS_Agreement__c.Name}', agr.Name);     
                    mail.setSubject(hSubject);
                    mail.setBccSender(false);
                    mail.setUseSignature(false);                
                    String hBody = empID.Body;
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.Name}', agr.Name);
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.CreatedBy}', agr.Owner.Name);
                   // hBody = hBody.replace('{!Apt3tus__APTS_Agreement__c.OwnerFullName}', agr.Owner.Name);
                    hBody = hBody.replace('{!Apttus__APTS_Agreement__c.Manager_Full_Name_CLM__c}', ManagerFullName);
                    mail.setPlainTextBody(hBody);
                    mailList.add(mail);
                    toAddresses.clear();
                }
             Messaging.sendEmail(mailList);
       
}

    global void finish(Database.BatchableContext bc)
{
        
}
    
    global void execute(SchedulableContext SC) 
{
        SendEmailNotification30Days_CLM batchable = new SendEmailNotification30days_CLM();
        database.executebatch(batchable);
}
}
  • December 10, 2018
  • Like
  • 0
how to cover public Sender Sender { get; set; } in test class  where sender is described as below 

public class Sender
{
    public string ServiceName { get; set; }
    public string SenderID { get; set; }
}

thanks in advance for help. 
  • November 13, 2018
  • Like
  • 0
hi , i have a apex class which has
 String recordTypeId = inputParameters.get('recordTypeId');
String accountId=inputParameters.get('accountId'); 

i nee dto have another input date, how can i take todays date as an input? 

thanks in advance for help. 
  • November 08, 2018
  • Like
  • 0
can somebody help me how to write test class for below class

global class WizardCallBack_CLM implements Apttus.WizardCustomClass.IDataSourceCallback{
      
      /*
        Description :- Accepts Account Id,Record Type Id,Parent Id and Account Name to autopopulate as parameter and sends the JSON response to be used in Wizard
        Input :- Wizard ID, Map of parameters passed in URL
        Output :- JSON response using class WizardCallbackResponse_CLM
      */
      global String getData(String wizardId,Map<String,String> inputParameters){
          String accountId=inputParameters.get('accountId');
          String recordTypeId = inputParameters.get('recordTypeId');
          String accountName=inputParameters.get('accountName');
          String parentId = inputParameters.get('parentId');
          String oemNames = inputParameters.get('oemNames').replace(';,',';');
          System.debug('>>>>>>>> accountName '+accountName);
          System.debug('>>>>>>>> parentId '+parentId);
          
          WizardCallbackResponse_CLM.WizardCallbackData data = new WizardCallbackResponse_CLM.WizardCallbackData();
          
          List<Apttus__WizardInputControl2__c> inputControlsList = [SELECT Apttus__Question__c,Apttus__WizardStepId__c FROM Apttus__WizardInputControl2__c where Apttus__WizardStepId__c in (SELECT id FROM Apttus__WizardStep2__c where Apttus__WizardDesignId__c =: Label.CPG)];
          
          List<WizardCallbackResponse_CLM.UserResponses> userResponseList= new List<WizardCallbackResponse_CLM.UserResponses>();
          System.debug('>>>>>>>>List'+inputControlsList);
          for(Apttus__WizardInputControl2__c inputObj :inputControlsList){
             System.debug('>>>>>>>>question'+inputObj.Apttus__Question__c);
             if(accountName!=null && inputObj.Apttus__Question__c == 'What is the legal name of the dealer?')
             {
                 System.debug('>>>>>>Inside If');
                 WizardCallbackResponse_CLM.UserResponses userResponse = new WizardCallbackResponse_CLM.UserResponses();
                 userResponse.Question = 'What is the company name?';
                 userResponse.inputRepeatSequence = 0;
                 userResponse.inputControlId = inputObj.id;
                 userResponse.Answer=accountName;
                 userResponseList.add(userResponse);
             }
             
             }
          }
                          
                  
          data.UserResponses = userResponseList;
          data.Parameters = null;    
          return JSON.serialize(data);
    }   
}
 
  • November 06, 2018
  • Like
  • 0
Hi, I have a custom setting "XYZ" and Name . I want to write a test class for retriving value of URLLink for custom settin "XYZ" . 
I have written my test class, and have properly inserted values for custom setting and URLLink but still i am getting " 
System.NullPointerException: Attempt to de-reference a null object.
can somebody pls help 


@AuraEnabled
    public static string GetCustomsettingValueName()
    {
        
        Object_Name Obj= Object_Name.getValues('XYZ settin'); 
        return Obj.URLLink;
    }

Testclass : 

 Custom_obj CDH = new Custom_obj();
         Custom_ob.Name = 'Test Custom settinges';
        CDH.URLLink='http://www.Test';
        insert CDH;
  • November 01, 2018
  • Like
  • 0
can somebody pls help me to write test class for below code in apex class
//Get RecordTypes name from Account Object
    @AuraEnabled
    public static string findRecordTypes(string objName){
        string returnString='';
        string queryString='Select id,name from RecordType where sobjectType =: objName  
       
        List<sobject> recordList= Database.query(queryString);
        List<RecordTypeWrapper> wrapperList=new List<RecordTypeWrapper>();
        for(sobject sb : recordList)  {
            RecordTypeWrapper rw=new RecordTypeWrapper();
            rw.recordTypeLabel=string.valueof(sb.get('name'));
            rw.recordTypeId=string.valueof(sb.get('id'));
            wrapperList.add(rw);
        }
        returnString= JSON.serialize(wrapperList);
       
        return returnString;
    }
 
 
  • October 31, 2018
  • Like
  • 0
Is it possible to add new action/button along with edit/delete values in drop down in salesforce lightning in the related list record.
In Opportunity record(in lightning) i have a related list. In the related list record we drop down actions edit and delete. I would like to add a custom action/button which will make a call to lightning component or vf page.

User-added image

thanks
amrut
  • September 21, 2018
  • Like
  • 0