• Clubli
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

I have successfully created a URL hack button to create a case, however I want to be able to populate the description field with 3 fields from the parent object.

 

I can get the fields to come in however I want each value displayed on a new line.

 

For example the description is currently:

Value1 Value2 Value3

 

Desired format:

Value1

Value2

Value3

 

Any ideas?

  • September 09, 2011
  • Like
  • 0

Hi,

 

I want to run a report that shows the number of accounts that have related contracts and the number that do not. Ideally I would like this displayed as a percentage.

 

I can create a report showing all accounts with/without contracts but I do not know how to break it down further to get the information I need.

 

Hope you can help.

  • September 08, 2011
  • Like
  • 0

Hi,

 

I have been working on a custom button on contracts. I want to be able to create a new case with a default record type. My problem is that I cannot get the contract lookup field to populate. The code I'm using is:

 

/500/e?RecordType=012P0000000CpQV&CF00NP0000000ZqEo_lkid={Contract.Id)&cas4={!Account.Name}

 

Everthing else is working fine, I just cannot get the contract lookup field to populate. Any ideas?

  • August 08, 2011
  • Like
  • 0

Hi, 

 

I know its too much to ask for a solution for this but I was just wondering if any of you know if this is possible.

 

When a certain field on accounts is changed, is there anyway to force the user to create a contract related to that account? Or even bring up the screen to create a contract.

 

Any suggestions or ideas would be greatly appreciated.

 

Thanks,

 

Clubli

I want to be able to send an email from cases where the "Additional To" field is automatically populated with a custom email address we have on cases (as we do not use contacts).

 

I have been looking around for some code to do this and I have found some but I cannot get it to work for me. Can anyone see where I am going wrong? Or are you aware of another solution for this issue. The code I have been trying is:

 

Public class SendEmail
{
    public String subject {get; set;}
    public String body {get; set;}
 
    private Case cas;
   
    // Constructor to populate instance of your object
    public SendEmail(ApexPages.StandardController controller) {
    this.cas= (Case )controller.getRecord();
    cas= [SELECT cas fields required
             FROM Case
             WHERE id = :ApexPages.CurrentPage().getParameters().get('id')​];
    }
             
    public Case getCase(){
    return cas;
    }
   
   
    public pageReference send(){
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();  
     
    email.setSubject(subject);
    email.setToAddresses(Customer_Email_Address__c);//Use SOQL to retrieve addresses in the address
    email.setPlainTextBody(body);
    email.setBccSender(true);
   
    Messaging.SendEmailResult [] r = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email});     
    for ( Messaging.sendEmailResult result : r ) {

           if ( !r[0].isSuccess () ) {
              
               System.debug ( result  );
           }

           else{

               ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' );
               ApexPages.addMessage(msg);
           }
       }
    return null;  
}
}

VF Page

 

<apex:page StandardController="Case" extensions="SendEmail">
<apex:pageblock title="">
<apex:pageMessages ></apex:pageMessages>
<apex:form >

<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="Send Email" action="{!send}"/>
</apex:form>
</apex:pageblock>
</apex:page>



 

I also tried a URL hack but could not get it to work because I am not a developer and not fully sure of what is needed.

 

Any help would be greatly appreciated.

 

Regards,

 

Clubli

Hi,

 

I'm trying to create a VF template for cases that will include the related Solution (from the Solutions related list on Cases).

 

I am getting an error: "Error: Invalid field Solution__r for SObject Case"

 

The code is as follows:

 

<messaging:emailTemplate subject="Test VF" recipientType="Contact" relatedToType="Case">
<messaging:htmlEmailBody>
<html>
<body>
<table border="0" >
<tr>

<th>Solution Detail</th>
<th>Solution Title</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.Solution__r}">
<tr>

<td>{!cx.SolutionNote}</td>
<td>{!cx.SolutionName}</td>
</tr>
</apex:repeat>
</table>
<p/>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

Is what I want to do possible? And if so, can you help me with the error I am receiving.

 

Thanks!!

Hi,

 

I want to run a report that shows the number of accounts that have related contracts and the number that do not. Ideally I would like this displayed as a percentage.

 

I can create a report showing all accounts with/without contracts but I do not know how to break it down further to get the information I need.

 

Hope you can help.

  • September 08, 2011
  • Like
  • 0

Hi,

 

I have been working on a custom button on contracts. I want to be able to create a new case with a default record type. My problem is that I cannot get the contract lookup field to populate. The code I'm using is:

 

/500/e?RecordType=012P0000000CpQV&CF00NP0000000ZqEo_lkid={Contract.Id)&cas4={!Account.Name}

 

Everthing else is working fine, I just cannot get the contract lookup field to populate. Any ideas?

  • August 08, 2011
  • Like
  • 0

Hi, 

 

I know its too much to ask for a solution for this but I was just wondering if any of you know if this is possible.

 

When a certain field on accounts is changed, is there anyway to force the user to create a contract related to that account? Or even bring up the screen to create a contract.

 

Any suggestions or ideas would be greatly appreciated.

 

Thanks,

 

Clubli

I want to be able to send an email from cases where the "Additional To" field is automatically populated with a custom email address we have on cases (as we do not use contacts).

 

I have been looking around for some code to do this and I have found some but I cannot get it to work for me. Can anyone see where I am going wrong? Or are you aware of another solution for this issue. The code I have been trying is:

 

Public class SendEmail
{
    public String subject {get; set;}
    public String body {get; set;}
 
    private Case cas;
   
    // Constructor to populate instance of your object
    public SendEmail(ApexPages.StandardController controller) {
    this.cas= (Case )controller.getRecord();
    cas= [SELECT cas fields required
             FROM Case
             WHERE id = :ApexPages.CurrentPage().getParameters().get('id')​];
    }
             
    public Case getCase(){
    return cas;
    }
   
   
    public pageReference send(){
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();  
     
    email.setSubject(subject);
    email.setToAddresses(Customer_Email_Address__c);//Use SOQL to retrieve addresses in the address
    email.setPlainTextBody(body);
    email.setBccSender(true);
   
    Messaging.SendEmailResult [] r = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email});     
    for ( Messaging.sendEmailResult result : r ) {

           if ( !r[0].isSuccess () ) {
              
               System.debug ( result  );
           }

           else{

               ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' );
               ApexPages.addMessage(msg);
           }
       }
    return null;  
}
}

VF Page

 

<apex:page StandardController="Case" extensions="SendEmail">
<apex:pageblock title="">
<apex:pageMessages ></apex:pageMessages>
<apex:form >

<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="Send Email" action="{!send}"/>
</apex:form>
</apex:pageblock>
</apex:page>



 

I also tried a URL hack but could not get it to work because I am not a developer and not fully sure of what is needed.

 

Any help would be greatly appreciated.

 

Regards,

 

Clubli

Hi,

 

I'm trying to create a VF template for cases that will include the related Solution (from the Solutions related list on Cases).

 

I am getting an error: "Error: Invalid field Solution__r for SObject Case"

 

The code is as follows:

 

<messaging:emailTemplate subject="Test VF" recipientType="Contact" relatedToType="Case">
<messaging:htmlEmailBody>
<html>
<body>
<table border="0" >
<tr>

<th>Solution Detail</th>
<th>Solution Title</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.Solution__r}">
<tr>

<td>{!cx.SolutionNote}</td>
<td>{!cx.SolutionName}</td>
</tr>
</apex:repeat>
</table>
<p/>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

Is what I want to do possible? And if so, can you help me with the error I am receiving.

 

Thanks!!