2011-01-27 4 views
0

こんにちはこれはAshwaqです 私はapexクラスとapexページを持っていますが、この2つのことはパッケージにアップロードする必要があります。このパッケージをアップロードしています。このエラーはありません "選択したtestMethodsは見つかりませんでしたパッケージのためのApexコード "。親切に私にこの解決策を知らせて、私に返信aspを与えてください。salesforceにパッケージをアップロードするには

頂点クラス:

public global virtual class SendEmailToFeedback 
{ 
    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('name'); 
      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(body + 'Click The Followoing Link http://tefllife.com/studentfeedback.html'); 
        try 
        { 
        Messaging.SendEmailResult [] resultMail= Messaging.sendEmail(new 

Messaging.SingleEmailMessage[] {email}); 
        if(resultMail[0].isSuccess())  
        response = 'ok sent!'; 
         else 
         { 
         response = resultMail[0].getErrors().get(0).getMessage(); 
         } 
        } 
        catch(System.EmailException ex) 
        { 
         response = ex.getMessage(); 
        } 
       } 

     } 

     return null; 
    } 

} 

頂点ページは次のとおりです。

<apex:page controller="SendEmailToFeedback" id="thePage"> 
<script> 
function confirmCancel() { 
var isCancel = confirm("Are you sure you wish to cancel?"); 
if (isCancel) return true; 
return false; 
} 
</script> 
<apex:form > 
    <apex:pageBlock > 

     <p>Fill out the fields below to test how you might send an email to a Opportunity.</p><br /> 
     <apex:dataTable value="{!Opp}" var="o" border="1"> 
      <apex:column > 
       <apex:facet name="header">Name</apex:facet> 
       {!o.Name} 
      </apex:column> 
      <apex:column > 
       <apex:facet name="header">Email</apex:facet> 
       {!o.Email__c} 
      </apex:column> 
     </apex:dataTable> 
     <br /><br /> 
     <apex:outputLabel value="Subject" for="Subject"/>:<br /> 
     <apex:inputText value="{!subject}" id="Subject" maxlength="80"/> 
     <br /><br /> 
     <apex:outputLabel value="Body" for="Body"/>:<br /> 
     <apex:inputTextarea value="{!body}" id="Body" rows="10" cols="80"/> 
     <br /><br /><br /> 
     <apex:commandButton value="SendEmail" action="{!send}"/> 
     <apex:commandButton action="{!cancel}" value="Cancel" 
     onclick="return confirmCancel()" immediate="true"/> 
     </apex:pageBlock> 
    </apex:form> 
</apex:page> 

答えて

3

あなたはユニットテストせずにサンドボックスにApexコードを展開することができ、しかし本番インスタンスにデプロイすると、あなたのためのユニットテストを書くためにあなたが必要ですエイペックスコード。

詳細情報はhere

また、運用サーバーにデプロイすることはあなたのユニットテストから少なくとも75%のコードカバレッジを必要とします。

関連する問題