Привет, это Ашвак
У меня есть класс apex и страница apex, и эти две вещи, которые я должен загрузить в пакет, пока я загружаю этот пакет, я получаю эту ошибку "В выбранном коде Apex для пакета не найдено testMethods". Поэтому, пожалуйста, дайте мне знать об этом решении. и дай мне ответ asp.
класс вершины:
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>