如何将apex类从开发人员版迁移到企业版

时间:2011-02-01 13:33:48

标签: salesforce

我在开发人员版中有顶级课程,我想使用apex expolrer IDE将此课程转移到enterprice版本,但我收到的错误是“所选顶点触发器的测试覆盖率为0,至少需要1%的测试覆盖率”。下面给出了顶级课程。请尽快通知我。

公共类SendEmailToFeedback {     public SendEmailToFeedback()     {

}
public SendEmailToFeedback(ApexPages.StandardController controller) 
{

}
public String items { get; set; }
Opportunity opportunity;
//public String subject{ get; set; }
//public String body { get; set; }
public String lid { get; set; }
public String response {get; set;}
List<Opportunity> Opp;
public PageReference cancel() 
{
    return null;
}   
public List<Opportunity> getOpp()
{
   if(Opp== null)
     {
       lid = System.currentPageReference().getParameters().get('id');
       Opp= [Select o.Name,o.Email__c from Opportunity o where o.id =:lid];
     }
    return Opp;
}
public PageReference send() 
{
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
    String addresses;
    if (Opp[0].Email__c != null)
    {
        addresses = Opp[0].Email__c;

            if (Opp[0].Email__c != null)
            {
                addresses += ':' + Opp[0].Email__C;
                String[] toAddresses = addresses.split(':', 0);
                email.setSenderDisplayName('THYLAKSOFT LLC');
               // email.setSubject(subject);
                email.setToAddresses(toAddresses);
                email.setPlainTextBody('Click The Followoing Link http://tefllife.com/studentfeedback.html');
                try
               {
                 Messaging.SendEmailResult [] resultMail= Messaging.sendEmail(new 

Messaging.SingleEmailMessage [] {email});                      如果(resultMail [0] .isSuccess())
                     response ='ok sent!';                       其他                       {                          response = resultMail [0] .getErrors()。get(0).getMessage();                       }                     }                     catch(System.EmailException ex)                     {                       response = ex.getMessage();                     }
                }

    }

    return null;
}

}

1 个答案:

答案 0 :(得分:3)

如果没有为其提供测试类,您将无法部署它,请参阅apex testing上的文档