• Indhurani Kanagaraj
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
Can someone please let me know how to write text class for this? What even i do Code is not getting coved. 

public static void insertInterfaceStagingTable(List<Case> casesList) {
        
        List<Interface_Staging_Table__c> istList = new List<Interface_Staging_Table__c>();
        for(Case tbEC :casesList){
            
            Interface_Staging_Table__c ist = new Interface_Staging_Table__c();
            ist.Interface_Type__c='Decisions Case entitlement';
            ist.Account_ID__c = tbEC.Account.id;
            ist.Account_Type__c = tbEC.Account.Account_Group__c;
            ist.Case_Number__c = tbEC.caseNumber;
            ist.CaseOverrideCostCenter__c = tbEC.Override_Cost_Center__c;
            ist.Installed_Product_ID__c = tbEC.Reference_Installed_Product__R.id;
            if(tbEC.Override_Cost_Center__c==null) {
                String companyCode = tbEC.Account_CompanyCode__c;
                Default_Cost_Center__C cc;
                if(companyCode!=null) {
                   cc = Default_Cost_Center__c.getValues(companyCode);
                }
                
                if(cc!=null && cc.CostCenter__c!=null) {
                    ist.Override_Cost_Center__c = cc.CostCenter__c;//obj.Override_Cost_Center__c
                } else {
                    ist.Override_Cost_Center__c ='';
                     System.debug('No cost center available');
                } 
            } else {
                ist.Override_Cost_Center__c = tbEC.Override_Cost_Center__c;
            }
            
            ist.Product_ID__c = String.valueof(tbEC.SVMXC__Product__c);
            ist.Service_Type__c = tbEC.Service_Type__c;
            ist.Event_Type__c = tbEC.reason;
            istList.add(ist);
        }
        
        List<System_Log__c> systemLogEntriesList;
        Database.UpsertResult[] result;        
        if(systemLogEntriesList==NULL){
            systemLogEntriesList= new List<System_Log__c>();
        }        
        try{
            if(istList <>NULL && !istList.isEmpty() ){
                result= Database.upsert(istList, false);
                System.debug('Interface Staging Records Upserted : ' + result);
            }
            if(result <> NULL){
                for(integer i= 0; i < result.size(); i++){
                    if(!result[i].isSuccess()) { 
                        systemLogEntriesList.add(createSystemLogEntry(istList[i].Id, 'Decisions Entitlement OB Message', 
                        'Insert of Interface Staging Table record :'+ casesList[i].Id +' for Decisions entitlement OB Message callout',  
                        'insertInterfaceStagingTable' ));                                                
                    }
                }
            }
        }catch(exception ex){
            //Just make an entry in the system log
            systemLogEntriesList.add(createSystemLogEntry('', 'Decisions Entitlement OB Message', 
            'DMLException while Insertion of Interface Staging Table record for Decisions entitlement OB Message callout : - ' +  
            ex.getMessage(), 'insertInterfaceStagingTable' ));
            //Added after PIL commenting
        }
        
        try{
            if(systemLogEntriesList <>NULL && !systemLogEntriesList.isEmpty() ){
                Database.insert(systemLogEntriesList, false); //Just for logging - no check if unsuccessful.
            }
        }catch(exception ex){
            System.debug('DMLException while Insertion of Interface Staging Table record for Decisions entitlement OB Message callout :'+ex.getMessage());  
        }        
        
    }
    
I have Table in visual force which pulls all currency value of perticular vendor in the year and few filters all performed to find total values quater values extra. i need to display comma after thousands. There are so many fileds so i cant if codition for all the fileds. Please let me know how to handel this?
 
I have created a report(Table) on visualforce with various filters.User should be able to export the changes when they apply any filter. I have seen many code with two visualforce pages,which allow me to download report but it works for constant report/table but here i must download report with changes made using single VF page.
I have non numeric field in an object. how to find unique value of that filed in soql quary?
Is it possible to add Drop down custom filters in reports? Or can it be done by visualforce?
User is unable to create new opportunity in lightning, When he tries to create new opportunity he is getting blank white screen. As an admin i logged into the user account and I am able to create new opportunity. Please help me to solve this.  
public class Handeller
{
    List<ID> tempAccList = new List<ID>();
     List<Account> aList = new List<Account>();
      List<Customer__c> cList = new List<Customer__c>(); 
      List<Account> aList1 = new List<Account>();
      
      public void getAccountId (List<Account> accList)
      {
          for (Account acc: accList)
          {
              tempAccList.add(acc.Id);
          }    
          if(!tempAccList.isEmpty())
          {
              createCustomer();
          }
       }
       
        public void createCustomer()
        {
          aList =[SELECT Id,Name,Phone,Role_of_the_main_contact__c FROM account WHERE Id IN:tempAcclist];
          for (Account acc1: aList)
          {
              Customer__c cust = new Customer__c();
              cust.Name = acc1.Name;
              cust.Phone__c= acc1.Phone;
              cust.Role_of_the_contact__c=acc1.Role_of_the_main_contact__c;
              cust.Related_Account__c=acc1.ID;
              cList.add(cust);
              
              acc1.Phone=null;
              acc1.Role_of_the_main_contact__c=null;
              aList1.add(acc1);
          }
          
          insert cList;
          update aList1;
          
        } 
}
I have Table in visual force which pulls all currency value of perticular vendor in the year and few filters all performed to find total values quater values extra. i need to display comma after thousands. There are so many fileds so i cant if codition for all the fileds. Please let me know how to handel this?
 
User is unable to create new opportunity in lightning, When he tries to create new opportunity he is getting blank white screen. As an admin i logged into the user account and I am able to create new opportunity. Please help me to solve this.