• kathir Ravan
  • NEWBIE
  • 9 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
I am new for test class  even i tried to write to test classes please find below.Please can any one help me what did i wrong my code i need code coverage.what should do i change my code.
This is trigger:
trigger Rfleet_UpdateforecastAllCountry on Country_DCVF_Volume__c (after insert,after update,after delete) {
string TempYear;
Integer TempMonth;

Integer FinalVolume=0;
Integer FinalForecast=0;
set<id>Ikamids=new set<id>();
set<id>Accountids=new set<id>();

if(trigger.isinsert||trigger.isupdate ){
for(Country_DCVF_Volume__c Dcvfcount:trigger.new){
    if(Dcvfcount.IKAM_Data__c!=null){
        Ikamids.add(Dcvfcount.IKAM_Data__c);
        Accountids.add(Dcvfcount.Parent_Account__c);
    }
}
}
if(trigger.isdelete){
for(Country_DCVF_Volume__c Dcvfcount:trigger.old){
    if(Dcvfcount.IKAM_Data__c!=null){
        Ikamids.add(Dcvfcount.IKAM_Data__c);
        Accountids.add(Dcvfcount.Parent_Account__c);
    }
}
}
list<country_dcvf_volume__c>listVol=[select id,insertion_date__c, country__c, Year__c from country_dcvf_volume__c where IKAM_Data__c in:Ikamids and Parent_Account__c in:Accountids ORDER BY insertion_date__c desc limit 1];

 for(country_dcvf_volume__c FirstList :listVol){
 
 TempYear=string.Valueof(FirstList.Year__c);
 TempMonth=integer.valueof(FirstList.insertion_date__c.month());
 
 }
 list<IKAM_Data__c>finalcount=new list<IKAM_Data__c>();
 list<country_dcvf_volume__c> SecondSortedList=[select id,Country_forecast__c ,IKAM_Data__c, Delivered_volume__c from country_dcvf_volume__c where IKAM_Data__c in:Ikamids and Parent_Account__c in:Accountids and Year__c =:TempYear and CALENDAR_month(insertion_date__c)=:TempMonth ];
 list<IKAM_Data__c>Ikamupdate=[select id,Countries_delivered_volume__c,Countries_forecast__c from IKAM_Data__c where id in:Ikamids ];
 for(country_dcvf_volume__c FinalList :SecondSortedList){
   for(IKAM_Data__c updateIkam:Ikamupdate){
      
          FinalVolume +=integer.valueof(FinalList.Delivered_volume__c);
          FinalForecast +=integer.valueof(FinalList.Country_forecast__c);
          updateIkam.Countries_delivered_volume__c=FinalVolume; 
          updateIkam.Countries_forecast__c=FinalForecast ;
     }
 }
 
  
update Ikamupdate;
  
}
It's test class:
@isTest
private class Rfleet_UpdateforecastAllCountry_Test {
static testmethod void Rfleet_UpdateforecastAllCountry_TestMethod(){

Country_DCVF_Volume__c ContryDCVF = new Country_DCVF_Volume__c(
Country__c='Algeria',
Parent_Account__c='001m000000Kg3ys',
Region__c='France',
Insertion_date__c=system.today(), 
KAM__c='Ganz Bruno',
Delivered_volume__c=1.5,
IKAM_Data__c='a3em0000000DCsq'
);
 insert ContryDCVF;   
}
}





 
I am new for integration part. I have been created for custom WSDL for custom object. when I generate the custom WSDL for that class I got all standard object and custom objects. But I need to have custom object WSDL only.why am getting all objects. Please can any one help me out how can I resolve this issue. Thanks in advance. Here below my classes what need do i changes..
 
global class kathir_WSDL {
public String vinNo { get; set; }

List<streamingAPI__vehile__c> results;

public List<streamingAPI__vehile__c>getResults() {
return results;
}

WebService static list<streamingAPI__vehile__c>search(string vinnr) {

list<streamingAPI__vehile__c>acc=[Select name, streamingAPI__Model__c,streamingAPI__Body_type__c,streamingAPI__color__c,streamingAPI__price__c from streamingAPI__vehile__c where Name =:vinnr];
system.debug('listof accounts'+acc);
 return acc;


  }
  public void searchrelated() {
  system.debug('listof varible'+vinNo);


 kathir_WSDL.search(vinNo);
results=[Select Name,streamingAPI__Model__c,streamingAPI__Body_type__c,streamingAPI__color__c,streamingAPI__price__c from streamingAPI__vehile__c where Name=:vinNo];

  }
}
Thanks,
Nikitha
 
Hi,

      I have create a email service to which I have a class attached to create contact record. When I send email from Gmail, redifmail I am able to receive email and contact is created but when I send a email from my personal company email id (myname@company.com) with company domain name I am not able to receive email id. Please guide me whet is the issue or what I am missing out to receive email from company domain name.

Thanks,
kathir
Hi,
I have working inbound email handler for using email service address through different doamin like gmail,yahoo etc.When I sent email service from gmail to salesforce some information inserted in my contact object like name,title email.Am trying to sent email service address from yahoo to salesforce it nothing happen in contact object.Why yahoo mail is not support in salesforce may i know what is the reason.please could you tel any suggestion...Here my inbound email handler class... 
global class ProcessJobApplicantEmail implements Messaging.InboundEmailHandler {
   
   global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
   Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
	
    contact contact = new contact();
    string emails=envelope.fromAddress;
    string domain = emails.substringafter('@').trim();
    string mToAddressBefore = emails.subString(0,emails.indexOf('@'));
    system.debug('domain------->'+domain); 

    List<String> domainscollection = new List<String>();
    list<streamingAPI__Email_Domain_Routing5__c> myCS1 =streamingAPI__Email_Domain_Routing5__c.getall().values();
    system.debug('domain list--------->'+myCS1);
    for(streamingAPI__Email_Domain_Routing5__c DomainName:myCS1){
    
    if(myCS1.size()>0)
     domainscollection.add(DomainName.streamingAPI__Domain_Name__c); 
    }
    
    system.debug('domain listsize--------->'+domainscollection.size());
    for(String Domainlist:domainscollection ){   
    if(domain==Domainlist){
     
        system.debug('loop domain listsize--------->'+Domainlist);
        system.debug('domain------->'+domain);
        contact.FirstName = email.fromname.substring(0,email.fromname.indexOf(''));
        contact.LastName = email.fromname.substring(email.fromname.indexOf(''));
        contact.Email =mToAddressBefore+'@'+domain;
        contact.Title=email.subject;
        insert contact;
        System.debug('--------->Created Contact'+contact.Id);
        
    }
  
 } 
     if (email.binaryAttachments != null && email.binaryAttachments.size() > 0) {
     for (integer i = 0 ; i < email.binaryAttachments.size() ; i++) {
     Attachment attachment = new Attachment();
       
       
      //attach to the newly created contact record
        attachment.ParentId = contact.Id;
        attachment.Name = email.binaryAttachments[i].filename;
        attachment.Body = email.binaryAttachments[i].body;
        insert attachment;
        
      }
    }

    return result;

  }
  }


 
Hi,

      I have create a email service to which I have a class attached to create contact record. When I send email from Gmail, redifmail I am able to receive email and contact is created but when I send a email from my personal company email id (myname@company.com) with company domain name I am not able to receive email id. Please guide me whet is the issue or what I am missing out to receive email from company domain name.

Thanks,
kathir