• Abhishek Singh 88
  • NEWBIE
  • 203 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 48
    Questions
  • 66
    Replies
Hi All,
I have a scenario where I have to assign owners based on various condition. Currently, we have Flows in place which checks the condition and does update Record. Now I am building an apex routing process where I need to check the conditions. In order to give flexibility, we want the condition should be configurable on UI and backend will do the calculation. e.g(1 OR 2) AND (3 OR 4) .

Any suggestion would be appreciated.
HYPERLINK("/" & Id & "#" & Id & "_00N600000037BUP_target", "Team Responsibilities URL", "_blank")

which point to related list record "Team Responsibility" in Classic. But if user has lighting enabled it redirect to Detail Tab. Is there any way we can point it to Related Tab if user has enabled lightning.
Hi All,
We have some routing processes configured using flow and process
builder. basically routing is based on category field. If category is A , its being routed to Queue abc. Our clients wants a way to view all the category which has been used in this routing process.

TIA.
Hi All,
I have query in for loop.I tried it to pull out side but it is not behaving properly. It is not updating respective record properly if take query out of loop.here is my code.
for(BMCServiceDesk__BMC_BaseElement__c berec:childCis)
        {       
             
               for(BMCServiceDesk__BMC_BaseRelationship__c brrec:sourcedestinationlist)
               {    
		            
                      if(brrec.BMCServiceDesk__Destination_ClassName__c=='BMC_Application')
						  
                          besourceid.add(brrec.BMCServiceDesk__Destination__c);
                   
               }
                   baseapplist=[select id,name,HITRUST__c,PCI__c,PHI__c,Fisma_High_New__c,Fisma_Low_New__c,Fisma_Mod_New__c,SOC__c,SOC2__c,SOX__c,Environment__c,UAR__c,BMCServiceDesk__ClassName__c from BMCServiceDesk__BMC_BaseElement__c where ID IN:besourceid];
			   
                   for(BMCServiceDesk__BMC_BaseElement__c baseapp:baseapplist)
                     {
                              if(baseapp.HITRUST__c)
                                  
                                  flag1=true;
                     }
				   for(BMCServiceDesk__BMC_BaseElement__c basebe:newbelist1)
                     {
						 
                        if(oldbelist1.get(basebe.id).HITRUST__c!=basebe.HITRUST__c && basebe.HITRUST__c==false)
                        {
                            if(flag1)
                            {
								
                              berec.HITRUST__c=true; 
                            }
                              else{
                                     berec.HITRUST__c=false;
                                }
                              baseelementlist.add(berec);								
		}}}

baseapplist is inside for loop. Want to keep outside of loop.
Thanks.
Hi All, 
Trigger recursion is still persisting , i have used static variable though. here is code snippet.
public void decommising(List<BMCServiceDesk__BMC_BaseElement__c> newbelist,map<id,BMCServiceDesk__BMC_BaseElement__c> oldbelist)
    {    
       
           for(BMCServiceDesk__BMC_BaseElement__c be:newbelist)
        {
            beid.add(be.id);
        }
if(CheckRecursive.cmdbserver1==false)
{
           serverdecommission(newbelist,oldbelist);
    }
}
public void serverdecommission(List<BMCServiceDesk__BMC_BaseElement__c> newbelist1,map<id,BMCServiceDesk__BMC_BaseElement__c> oldbelist1)
for(BMCServiceDesk__BMC_BaseElement__c berec:childCis)//related base element record could be source or destination
        {
//putting relationship for ci's in map, to get id of cis level 2.
              if(destinationmap1.get(berec.id)!=null)
              destinationList.addAll(destinationmap1.get(berec.id));
               system.debug('destinationList'+destinationList);
               if(sourcemap1.get(berec.id)!=null)
               sourceList.addAll(sourcemap1.get(berec.id));
                system.debug('sourceList'+sourceList);
                if(sourceList.size()>0)
                sourcedestinationlist.addAll(sourceList);
                  if(destinationList.size()>0)
                sourcedestinationlist.addAll(destinationList);
               system.debug('sourcedestinationlist'+sourcedestinationlist);
               for(BMCServiceDesk__BMC_BaseRelationship__c brrec:sourcedestinationlist)
               {
                   if(brrec.BMCServiceDesk__Source_ClassName__c=='BMC_Application')
                       besourceid.add(brrec.BMCServiceDesk__Source__c);
                      if(brrec.BMCServiceDesk__Destination_ClassName__c=='BMC_Application')
                          besourceid.add(brrec.BMCServiceDesk__Destination__c);
                   
               }
               if(besourceid.size()>0)
                   baseapplist=[select id,name,HITRUST__c,PCI__c,PHI__c,Fisma_High_New__c,Fisma_Low_New__c,Fisma_Mod_New__c,SOC__c,SOC2__c,SOX__c,Environment__c,UAR__c,BMCServiceDesk__ClassName__c from BMCServiceDesk__BMC_BaseElement__c where ID IN:besourceid];
                   system.debug('baseapplist'+baseapplist);
                   
                   for(BMCServiceDesk__BMC_BaseElement__c baseapp:baseapplist)
                     {
                              if(baseapp.HITRUST__c)
                                  
                                  flag1=true;
                     }
                     for(BMCServiceDesk__BMC_BaseElement__c basebe:newbelist1)
                     {
                        if(oldbelist1.get(basebe.id).HITRUST__c!=basebe.HITRUST__c && basebe.HITRUST__c==false)
                        {
                            if(flag1)
                            {
                              berec.HITRUST__c=true;  
                            }
                              else{
                                     berec.HITRUST__c=false;
                                }                           
                     }
                     }
        baseelementlist.add(berec); 
        }
basemap.putAll(baseelementlist);
        system.debug('base map'+basemap.values());
           if (basemap.size()>0)
           {
              update basemap.values();
            CheckRecursive.cmdbserver1=true;
 
               system.debug(basemap);
              }   
    }

Any help would be appriciated.
Hi all,
My trigger is being called twice, even I have used a static variable. Please find the class.
public void decommissioning(List<Incident>newlist,map<id,incident>oldmap) 
{
      if(checkrecursive.run==true)
 {
       serverdecomissioning(newlist,oldmap);
    checkrecursive.run=false;
}
}
public void serverdecomissioning(List<Incident>newlist1,map<id,incident>oldmap1)
{
//code
}

 
Hi developer,
I have a doubt regarding to filtering the SOQL query.
I have a three set of id's that is:
Set<id> source;
Set<id>destination;
Set<id> sharedserver;(contains id of source and destination as well)
I have wrote query 
baselist=[select id ,name from base element where id in:sharedserver And( not in:source And not in: destination)]

but its not giving exact output. Can anyone help me out?
Thanks.
Hi All, I have queried parent object through child . and want to update parent object with some values. Here is query.
List<BMC_Servicedesk_BaseElement> belist=new List<BMC_Servicedesk_BaseElement>();
belist=[select name, Fisma_Low,Fisma_High from BMC_Servicedesk_BaseElement ];
List<BMC_Servicedesk_BaseRelationShip> bsrelation=new List<BMC_Servicedesk_BaseRelationShip> ();
List<BMC_Servicedesk_BaseRelationShip> bsrelation1=new List<BMC_Servicedesk_BaseRelationShip> ();
bsrelation=[select name, Destination__r.Hitrust,Destination__r.Fisma_Low,Destination__r.Fisma_High from BMC_Servicedesk_BaseRelationShip];
for(BMC_Servicedesk_BaseElement be: belist)
{
   for(BMC_Servicedesk_BaseRelationShip berel:bsrelation)
  {
     if(be.Fisma_Low==true)
  berel.Destination__r.Fisma_Low=be.Fisma_Low;
   bsrelation1.add(berel);
}
}
update bsrelation1;
//Note Base Relationship has two lookup filed with same object Base Element As destination__c and Source__c
Hi All,

I have a formula field called as "Number of days breached" which have formula
RCA_dueDate__c-NOW()
I want this formula should run only when RCA status is apprved somthing like this
IF(RCA_status='Approved',RCA_dueDate__c-NOW(),do nothing)

i tried this way
IF(RCA_status='Approved',RCA_dueDate__c-NOW(),Number_of_Brached_days__c)

But it gave error.

Any help would be appriciated​​​​​​​
 
Hi All,

I have below data in Description Field of incident.

Application: Oracle eBusiness Suite (eBS)
Change Driver: Migration
Change Category: New scripts
Is this Change part of a Project?: Yes
Non-Technical Reason for Change?: Importing Fieldglass invoices programatically
Do we need a WebEx?: No
Why is WebEx NOT Required?: It is a new component. And all the details are discussed with the functional team.
WebEx/Bridge Information: 
Number of Users Affected: Internal – None
Worst Case if not Implemented: Oracle might not able to import fieldglass invoices
End user experience if Change fails: Oracle might not able to import fieldglass invoices
End User Experience during Change: Once change implemented successfully. User might able to import fieldglass invoice

I want to parse it and want to store only bold text(Number of Users Affected)

Any Suggestion would be appriciated
Hi All,
I have a vf page which have two radio button Yes or No. I want selected value in constructor after clicking on submit buton.
here is code.
<apex:page controller="CCO_ScheduleACallController">
<apex:form >
<apex:pageBlock >
<apex:outputLabel style="Bold">Are you able to launch your software or service?</apex:outputLabel>
<apex:selectRadio value="{!radiovalue}">
          <apex:selectOption itemLabel="Yes" itemValue="1"></apex:selectOption>
          <apex:selectOption itemLabel="No" itemValue="2"></apex:selectOption>
      </apex:selectRadio>
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!Submit}" value="Submit"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

Since in the exisitng contrroler most of the logic is implemented in constructor. And now i have to add condition
IF(selected value=='Yes')
{
//code
}
else
{
// code
}
Hi everyone,
I want to create a picklist on a visualforce page , And the values of picklist should be values in a List.
Eg. I have a list called "CCO_producttype". And now on the VF page i want to display Values(CCO_producttype) in a dropdown format.
How would i approach. Any suggestion on this would be highly appriciated.
There are some users which have "Automatically add my default opportunity team to opportunities that I create or open opportunities that are transferred to me" check box is true .So as soon as they create opportunity opportunity team member gets created. Is there any way where we can create an user with this capability in test class.
Thanks.
Hi All,
I have written a small trigger on opportunity.Which is updating field 'opportunity sales Leader' with the user in opportunity team member.Here is trigger.
trigger UpdateOpportunity on Opportunity (after insert) 
{
    Set<Id> setOfOppty = new Set<Id>();
    List<Opportunity> listOfOpptyToUpdate = new List<Opportunity>();
    for(Opportunity opp : Trigger.New){
        if(opp != null && (opp.RecordTypeId == Label.Oppty_Record_Type_ISV || opp.RecordTypeId == Label.Oppty_Record_Type_OEM || opp.RecordTypeId == Label.Oppty_Record_Type_Wholesale || opp.RecordTypeId == Label.Oppty_Record_Type_xSP)){
            setOfOppty.add(opp.Id);
        }
    }
    List<OpportunityTeamMember> listOTM = new List<OpportunityTeamMember>([SELECT Id, UserId, OpportunityId, User.Name FROM OpportunityTeamMember WHERE OpportunityId in :setOfOppty AND TeamMemberRole = :Label.Opportunity_Sales_Leader]);
    for(OpportunityTeamMember otmObj: listOTM){
        
        if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }
    }   
    if(!listOfOpptyToUpdate.IsEmpty()){
        Database.SaveResult[] saveResultList = Database.update(listOfOpptyToUpdate,false);
        for(Database.SaveResult svResult : saveResultList){
            if(!svResult.isSuccess()){                
                system.debug('Error::'+svResult);
                break;
            }
        }
    }
}

And Here Is Test clas.;
@Istest(SeeAllData=false)
Private class Test_opportunity 
{
     public static testmethod void testOpportunity()
     {   
         //ProId = [SELECT Id FROM Profile WHERE Name = 'Consumer Sales Ops'].Id;
         User user = new User();
        
        user.FirstName = 'Test';
        user.LastName = 'Name';
        user.CompanyName = 'IT Test Company';
        user.MobilePhone = '123-456-7890';
        
        user.Username = 'testUser-' + '@test.com';
        user.Email = 'testUser-' +'@test.com';
  user.Alias = 'test';
        user.CommunityNickname = 'test1';
        user.TimeZoneSidKey = 'America/New_York';
        user.LocaleSidKey = 'en_US';
        user.EmailEncodingKey = 'UTF-8';
        user.ProfileId = '00e1I000000Veel';
        user.LanguageLocaleKey = 'en_US';
        
        user.Street = '123 Test St';
        user.City = 'Testcity';
        user.State = 'va';
        user.PostalCode = '23223';
        user.Country = 'USA';
        
        insert user;
         Date myDate = Date.today();
         Opportunity opp=new opportunity();
         opp.RecordTypeId='0122F0000004ot9';
         opp.name='test opp';
         opp.AccountId='0012F00000EXcyQ';
         opp.CurrencyIsoCode='AED';
         opp.CloseDate= myDate;
         opp.StageName='Identification';
         opp.Opportunity_Team_Member_Sales_Leader__c=user.Id;
         insert opp;
         OpportunityTeamMember opptyteam=new OpportunityTeamMember();
         opptyteam.opportunityId=opp.Id;
         opptyteam.TeamMemberRole='Sales Leader';
         opptyteam.UserId=user.Id;
         insert opptyteam;
         opp.Opportunity_Team_Member_Sales_Leader__c = opptyteam.UserId;
         update opp;
         
     }
}

But its covering only 53 %
if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }

this if condition and also error statment is not been covered.any suggestion on this would be really help full
Hi Developers.
I have written a trigger to update a lookup field in an object i.e. Incident. once field is updated based on that i have implemented a workflow which have email alert action.But i could see that field is being updated but the workflow is triggering even the entry criteria is matching..

Any help would be appriciated.
Hi Developers,
I am trying to trace some class but in debug it is showing somthing like this

User-added image

How can i view those 4 entries.
Any help would be appriciated.
Hi Developers,
I am Facing strange issue. My class has 94% code coverage, i checked in eclipse as well. but while deploying this class it shows code coverage failure, only  61% code coverage, Even though i used RUN specified tests option.

Any help on this will be appriciated.
Hi Developer,
I want to trace an apex class let say class A. Basically it is an email service. When i am sending an email to particular email service address,Class A should invoke but it's not happening. To trace the class i have ganereted debug log for user as myself.
But i am not getting any entry in debug log. Wheareas for other email service i am getting debug log.

Any Help would be appriciated. 
Hi Developers,
I have written test class but it is not covering catch block.
APex class is here.
try
               {  
                 
                   history.Status__c='success';
                   history.Description__c=myPlainText;
                   //if(newIncident !=null)
                   history.Incident__c=newIncident.ID;
                   if(user != null && user.size() > 0)
                   history.account__c=user[0].BMCServiceDesk__Account_Name__c;
                   //emailhistory.add(history);
                   insert history;
               }
               catch(Exception ex){
      myPlainText = '';
      RF_Exception_Util.createException('McKesson','handleInboundEmail','McKessonNewIncidentCreation',ex.getMessage(),null);
    }

RF_Exception_Util is a class and createException is a static method. from here we are storing exception in some custom object.
Any suggestion will be appriciated.
Hi developers,
Here i have written a class, which is inserting an incident and after insertion i am trying put id of that incident in another child object
BMCServiceDesk__Incident__c newincident= new BMCServiceDesk__Incident__c();
newincident.Name='Wellspan';
newincident.description__c='Test cases.'
insert newincident;
// second object related as lookup, incident__c is field related to it.
email_to_incident_history__c emailincident=new email_to_incident_history__c();
emailincident.incident__c=newincident.Name;
insert emailincident;
But it is throwing an error, saying invalid id.
 
Hi All,
I have a scenario where I have to assign owners based on various condition. Currently, we have Flows in place which checks the condition and does update Record. Now I am building an apex routing process where I need to check the conditions. In order to give flexibility, we want the condition should be configurable on UI and backend will do the calculation. e.g(1 OR 2) AND (3 OR 4) .

Any suggestion would be appreciated.
Hi All,
We have some routing processes configured using flow and process
builder. basically routing is based on category field. If category is A , its being routed to Queue abc. Our clients wants a way to view all the category which has been used in this routing process.

TIA.
Hi All,
I have query in for loop.I tried it to pull out side but it is not behaving properly. It is not updating respective record properly if take query out of loop.here is my code.
for(BMCServiceDesk__BMC_BaseElement__c berec:childCis)
        {       
             
               for(BMCServiceDesk__BMC_BaseRelationship__c brrec:sourcedestinationlist)
               {    
		            
                      if(brrec.BMCServiceDesk__Destination_ClassName__c=='BMC_Application')
						  
                          besourceid.add(brrec.BMCServiceDesk__Destination__c);
                   
               }
                   baseapplist=[select id,name,HITRUST__c,PCI__c,PHI__c,Fisma_High_New__c,Fisma_Low_New__c,Fisma_Mod_New__c,SOC__c,SOC2__c,SOX__c,Environment__c,UAR__c,BMCServiceDesk__ClassName__c from BMCServiceDesk__BMC_BaseElement__c where ID IN:besourceid];
			   
                   for(BMCServiceDesk__BMC_BaseElement__c baseapp:baseapplist)
                     {
                              if(baseapp.HITRUST__c)
                                  
                                  flag1=true;
                     }
				   for(BMCServiceDesk__BMC_BaseElement__c basebe:newbelist1)
                     {
						 
                        if(oldbelist1.get(basebe.id).HITRUST__c!=basebe.HITRUST__c && basebe.HITRUST__c==false)
                        {
                            if(flag1)
                            {
								
                              berec.HITRUST__c=true; 
                            }
                              else{
                                     berec.HITRUST__c=false;
                                }
                              baseelementlist.add(berec);								
		}}}

baseapplist is inside for loop. Want to keep outside of loop.
Thanks.
Hi all,
My trigger is being called twice, even I have used a static variable. Please find the class.
public void decommissioning(List<Incident>newlist,map<id,incident>oldmap) 
{
      if(checkrecursive.run==true)
 {
       serverdecomissioning(newlist,oldmap);
    checkrecursive.run=false;
}
}
public void serverdecomissioning(List<Incident>newlist1,map<id,incident>oldmap1)
{
//code
}

 
Hi All, I have queried parent object through child . and want to update parent object with some values. Here is query.
List<BMC_Servicedesk_BaseElement> belist=new List<BMC_Servicedesk_BaseElement>();
belist=[select name, Fisma_Low,Fisma_High from BMC_Servicedesk_BaseElement ];
List<BMC_Servicedesk_BaseRelationShip> bsrelation=new List<BMC_Servicedesk_BaseRelationShip> ();
List<BMC_Servicedesk_BaseRelationShip> bsrelation1=new List<BMC_Servicedesk_BaseRelationShip> ();
bsrelation=[select name, Destination__r.Hitrust,Destination__r.Fisma_Low,Destination__r.Fisma_High from BMC_Servicedesk_BaseRelationShip];
for(BMC_Servicedesk_BaseElement be: belist)
{
   for(BMC_Servicedesk_BaseRelationShip berel:bsrelation)
  {
     if(be.Fisma_Low==true)
  berel.Destination__r.Fisma_Low=be.Fisma_Low;
   bsrelation1.add(berel);
}
}
update bsrelation1;
//Note Base Relationship has two lookup filed with same object Base Element As destination__c and Source__c
Hi All,

I have a formula field called as "Number of days breached" which have formula
RCA_dueDate__c-NOW()
I want this formula should run only when RCA status is apprved somthing like this
IF(RCA_status='Approved',RCA_dueDate__c-NOW(),do nothing)

i tried this way
IF(RCA_status='Approved',RCA_dueDate__c-NOW(),Number_of_Brached_days__c)

But it gave error.

Any help would be appriciated​​​​​​​
 
Hi everyone,
I want to create a picklist on a visualforce page , And the values of picklist should be values in a List.
Eg. I have a list called "CCO_producttype". And now on the VF page i want to display Values(CCO_producttype) in a dropdown format.
How would i approach. Any suggestion on this would be highly appriciated.
Hi All,
I have written a small trigger on opportunity.Which is updating field 'opportunity sales Leader' with the user in opportunity team member.Here is trigger.
trigger UpdateOpportunity on Opportunity (after insert) 
{
    Set<Id> setOfOppty = new Set<Id>();
    List<Opportunity> listOfOpptyToUpdate = new List<Opportunity>();
    for(Opportunity opp : Trigger.New){
        if(opp != null && (opp.RecordTypeId == Label.Oppty_Record_Type_ISV || opp.RecordTypeId == Label.Oppty_Record_Type_OEM || opp.RecordTypeId == Label.Oppty_Record_Type_Wholesale || opp.RecordTypeId == Label.Oppty_Record_Type_xSP)){
            setOfOppty.add(opp.Id);
        }
    }
    List<OpportunityTeamMember> listOTM = new List<OpportunityTeamMember>([SELECT Id, UserId, OpportunityId, User.Name FROM OpportunityTeamMember WHERE OpportunityId in :setOfOppty AND TeamMemberRole = :Label.Opportunity_Sales_Leader]);
    for(OpportunityTeamMember otmObj: listOTM){
        
        if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }
    }   
    if(!listOfOpptyToUpdate.IsEmpty()){
        Database.SaveResult[] saveResultList = Database.update(listOfOpptyToUpdate,false);
        for(Database.SaveResult svResult : saveResultList){
            if(!svResult.isSuccess()){                
                system.debug('Error::'+svResult);
                break;
            }
        }
    }
}

And Here Is Test clas.;
@Istest(SeeAllData=false)
Private class Test_opportunity 
{
     public static testmethod void testOpportunity()
     {   
         //ProId = [SELECT Id FROM Profile WHERE Name = 'Consumer Sales Ops'].Id;
         User user = new User();
        
        user.FirstName = 'Test';
        user.LastName = 'Name';
        user.CompanyName = 'IT Test Company';
        user.MobilePhone = '123-456-7890';
        
        user.Username = 'testUser-' + '@test.com';
        user.Email = 'testUser-' +'@test.com';
  user.Alias = 'test';
        user.CommunityNickname = 'test1';
        user.TimeZoneSidKey = 'America/New_York';
        user.LocaleSidKey = 'en_US';
        user.EmailEncodingKey = 'UTF-8';
        user.ProfileId = '00e1I000000Veel';
        user.LanguageLocaleKey = 'en_US';
        
        user.Street = '123 Test St';
        user.City = 'Testcity';
        user.State = 'va';
        user.PostalCode = '23223';
        user.Country = 'USA';
        
        insert user;
         Date myDate = Date.today();
         Opportunity opp=new opportunity();
         opp.RecordTypeId='0122F0000004ot9';
         opp.name='test opp';
         opp.AccountId='0012F00000EXcyQ';
         opp.CurrencyIsoCode='AED';
         opp.CloseDate= myDate;
         opp.StageName='Identification';
         opp.Opportunity_Team_Member_Sales_Leader__c=user.Id;
         insert opp;
         OpportunityTeamMember opptyteam=new OpportunityTeamMember();
         opptyteam.opportunityId=opp.Id;
         opptyteam.TeamMemberRole='Sales Leader';
         opptyteam.UserId=user.Id;
         insert opptyteam;
         opp.Opportunity_Team_Member_Sales_Leader__c = opptyteam.UserId;
         update opp;
         
     }
}

But its covering only 53 %
if(otmObj != null && otmObj.UserId!=null && otmObj.OpportunityId != null){
            Opportunity opp = new Opportunity(Id = otmObj.OpportunityId, Opportunity_Team_Member_Sales_Leader__c = otmObj.UserId);
            listOfOpptyToUpdate.add(opp);
        }

this if condition and also error statment is not been covered.any suggestion on this would be really help full
Hi Developers,
I am trying to trace some class but in debug it is showing somthing like this

User-added image

How can i view those 4 entries.
Any help would be appriciated.
Hi Developers,
I am Facing strange issue. My class has 94% code coverage, i checked in eclipse as well. but while deploying this class it shows code coverage failure, only  61% code coverage, Even though i used RUN specified tests option.

Any help on this will be appriciated.
Hi Developers,
I have written test class but it is not covering catch block.
APex class is here.
try
               {  
                 
                   history.Status__c='success';
                   history.Description__c=myPlainText;
                   //if(newIncident !=null)
                   history.Incident__c=newIncident.ID;
                   if(user != null && user.size() > 0)
                   history.account__c=user[0].BMCServiceDesk__Account_Name__c;
                   //emailhistory.add(history);
                   insert history;
               }
               catch(Exception ex){
      myPlainText = '';
      RF_Exception_Util.createException('McKesson','handleInboundEmail','McKessonNewIncidentCreation',ex.getMessage(),null);
    }

RF_Exception_Util is a class and createException is a static method. from here we are storing exception in some custom object.
Any suggestion will be appriciated.
Hi developers,
Here i have written a class, which is inserting an incident and after insertion i am trying put id of that incident in another child object
BMCServiceDesk__Incident__c newincident= new BMCServiceDesk__Incident__c();
newincident.Name='Wellspan';
newincident.description__c='Test cases.'
insert newincident;
// second object related as lookup, incident__c is field related to it.
email_to_incident_history__c emailincident=new email_to_incident_history__c();
emailincident.incident__c=newincident.Name;
insert emailincident;
But it is throwing an error, saying invalid id.
 
Hi Developers.
Here i have written a class
Global class Email_History_schedule implements system.Schedulable
{
     global void execute(SchedulableContext sc)
     {
         try
         {
            List<Email_to_incident_History__c>emailtoincident=new List<Email_to_incident_History__c>();
             for(Email_to_incident_History__c einci:[select id from Email_to_incident_History__c])
             {
                 emailtoincident.add(einci);
             }
             delete emailtoincident;
             system.debug('Email history List'+emailtoincident);
         }
         catch(exception ex)
         {
             
         }
     }
}

And here is my test class
@istest
public class Email_History_schedule_Test 
{
   public static testMethod void testschedule() {
Test.StartTest();
Email_to_incident_History__c abc= new Email_to_incident_History__c();
abc.account__c='Mckesson';
abc.Description__c='Success';
insert abc;
List<Email_to_incident_History__c> emailto=new List<Email_to_incident_History__c>();
 emailto.add(abc);
 delete emailto;
 Email_History_schedule sh1 = new Email_History_schedule();
String sch = '0 0 23 * * ?';
system.schedule('CHS SR Report', sch, sh1);
Test.stopTest();
}   
}

But it is covering only 62%.
This line is not been covered
{
                 emailtoincident.add(einci);

 
Hi Developers,
I have writtent code where i am checking that object__c have any duplicate value in text area field.I have written bellow code
if( ( email.subject.containsIgnoreCase('Ticket#') || email.subject.containsIgnoreCase('Ticket #') || email.subject.containsIgnoreCase('Incident#') || email.subject.containsIgnoreCase('Incident #') ) && email.subject.contains('[')){
        ticketid = email.Subject.substring(email.Subject.indexOf('[')+1, email.Subject.indexOf(']'));
      }else if(email.subject.containsIgnoreCase('Ref:IN:')){
        ticketid = email.subject.substring(email.Subject.indexOf('IN:')+3,email.Subject.indexOf(')'));
      }
      List<BMCServiceDesk__Incident__c> newinci=new List<BMCServiceDesk__Incident__c>();
      system.debug('trying to insert ticket values');
      for(BMCServiceDesk__Incident__c inci:[select id,BMCServiceDesk__EmailServiceAddress__c from BMCServiceDesk__Incident__c])
      {
          if (inci.BMCServiceDesk__EmailServiceAddress__c.contains(ticketid))
          {
              newinci.add(inci);
              system.debug('ticket id added to incident');
          }
      }
it showing  Attempt to de-reference a null object error 
for this one
for(BMCServiceDesk__Incident__c inci:[select id,BMCServiceDesk__EmailServiceAddress__c from BMCServiceDesk__Incident__c])
      {
          if (inci.BMCServiceDesk__EmailServiceAddress__c.contains(ticketid))
          {
              newinci.add(inci);
              system.debug('ticket id added to incident');
          }
}

Any help will be appriciated.

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.