• Malik Butler
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 11
    Replies
I am trying to get the most recent comment from the case comments related field into my pdf. I have it currently coded to put the comment body in but if there's more than one comment in the related field it puts all comments in the pdf. Where should I go from here? 
<table style="page-break-inside:avoid" border="3">
  <tr style="font-weight: bold;font-color:Black;">
   <td colspan="1" bgcolor="#9FC6F9">Work Performed</td>
     </tr>
  <tr width = "100%">
    <td  style="height:45px;" width = "5%"><apex:pageBlock >
        <apex:pageBlockTable value="{!case.casecomments}" var="c">
            <apex:column value="{!c.commentbody}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</td>

 
I am trying to add case comments into a visualforce pdf I'm making. I want to see the most recent comment displayed and I've tried {!Case.Last_Case_Comment} as well as {!Case.CaseComments}, {!Case.CaseComments.CommentBody} and nothing seems to work. Using {!Case.CaseComments} It shows the ID so I think I just need the last piece to finish this but I'm unsure where to go. Please help!!
<table border="3">
  <tr style="font-weight: bold;font-color:Black;">
   <td colspan="1" bgcolor="#9FC6F9">Work Performed</td>
     </tr>
  <tr width = "100%">
    <td  style="height:45px;" width = "5%">{!Case.CaseComments}</td>
    <br/>
  </tr>         
</table>
I'm trying to create a vf page that will allow me to calculate two fields. Basically I need the quantity multiplied by the typical time to install(custom field), to get the Total Estimated Install time(custom field). I'm stumped as to if I can do it with apex code or if I should try to use html or css.
I'm trying to create checkboxes for a few different things. It isn't a field, just a label but I'm not sure what to do because nothing seems to work. 
<tr width = "100%">
    <td width = "5%"><label>
        <input type="checkbox" value="Customer Damage"/>
        <span>Customer Damage</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Water Related"/>
        <span>Water Related</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Environmental"/>
        <span>Environmental</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Non IPS Equiptment"/>
        <span>Non IPS Equiptment</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="User Error"/>
        <span>User Error</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Power Surge"/>
        <span>Power Surge</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="New Equiptment Install"/>
        <span>New Equiptment Install</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Other"/>
        <span>Other</span>
      </label></td>
I'm trying to style a vf page from a pdf that I made a static resource. I've added the code but nothing changed. Is there anything I can fix?

 
<apex:page standardController="Case" renderAs="pdf" applyBodyTag="true">
    <head>
        <style> 
           <apex:stylesheet value="{URLFOR(!$Resource.CasePDF)}"/>
            <apex:includeScript value="{!$Resource.CasePDF}"/>
        </style>
    </head>
    <body>
      <center>
        <h1>Service Work Order</h1>
       <h6>Integrated Precision Systems</h6>
<h6>9321 Ravenna Rd. Suite C. Twinsburg, OH 44087</h6>
       <h6><apex:outputText value="{!Case.CaseNumber}"/> <apex:outputText /></h6>
      </center>
         </body>
    <apex:form ><apex:inputTextarea richText="true"/></apex:form>  <body>
    <left><apex:outputText value="{!Case.Account.Name}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Contact.Name}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Phone__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Address__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Subject}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Description}"/> </left>
    </body>
</apex:page>

 
<apex:page standardController="Case" renderAs="pdf" applyBodyTag="true">
    <head>
        <style> 
            body { font-family: 'Times New Roman Unicode MS'; }
            .companyName { font: bold 30px; color: red; }  
        </style>
    </head>
    <body>
        <center>
        <h1>Service Work Order</h1>
        <h4>Integrated Precision Systems</h4>
        <h6>9321 Ravenna Rd. Suite C. Twinsburg, OH 44087</h6>
      
        </center>
      <left><apex:outputText value="{!Case.CaseNumber}"/> <apex:outputText /></left>
       
         </body>
    <body>
    <left><apex:outputText value="{!Case.Subject}"/> </left>
    
    </body>
    <body>
    <left><apex:outputText value="{!Case.Priority}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Account_Name__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Type}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Description}"/> </left>
    </body>
</apex:page>
User-added imagePlease help don't know if there is anything I'm doing wrong or if it is anything that I can fix.
 
<apex:page controller="Calculator"> <apex:form > <apex:inputText value="{!number1}"/> <apex:inputText value="{!number2}"/> <apex:inputText value="{!operator}"/> <apex:commandButton value="Show Result" action="{!calculation}">{!result} </apex:commandbutton> </apex:form> </apex:page>


CONTROLLER

public class Calculator
{
public integer number1{get;set;}
public integer number2{get;set;}
public string operator{get;set;}
public double result{get;set;}
public void calculation()
{
if(operator.contains('+'))
result=number1+number2;
if(operator.contains('-'))
result=number1-number2;
if(operator.contains('*'))
result=number1*number2;
if(operator.contains('/'))
result=number1/number2;
}
}
 
I am trying to add case comments into a visualforce pdf I'm making. I want to see the most recent comment displayed and I've tried {!Case.Last_Case_Comment} as well as {!Case.CaseComments}, {!Case.CaseComments.CommentBody} and nothing seems to work. Using {!Case.CaseComments} It shows the ID so I think I just need the last piece to finish this but I'm unsure where to go. Please help!!
<table border="3">
  <tr style="font-weight: bold;font-color:Black;">
   <td colspan="1" bgcolor="#9FC6F9">Work Performed</td>
     </tr>
  <tr width = "100%">
    <td  style="height:45px;" width = "5%">{!Case.CaseComments}</td>
    <br/>
  </tr>         
</table>
I'm trying to create a vf page that will allow me to calculate two fields. Basically I need the quantity multiplied by the typical time to install(custom field), to get the Total Estimated Install time(custom field). I'm stumped as to if I can do it with apex code or if I should try to use html or css.
I'm trying to create checkboxes for a few different things. It isn't a field, just a label but I'm not sure what to do because nothing seems to work. 
<tr width = "100%">
    <td width = "5%"><label>
        <input type="checkbox" value="Customer Damage"/>
        <span>Customer Damage</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Water Related"/>
        <span>Water Related</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Environmental"/>
        <span>Environmental</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Non IPS Equiptment"/>
        <span>Non IPS Equiptment</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="User Error"/>
        <span>User Error</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Power Surge"/>
        <span>Power Surge</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="New Equiptment Install"/>
        <span>New Equiptment Install</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Other"/>
        <span>Other</span>
      </label></td>
I'm trying to style a vf page from a pdf that I made a static resource. I've added the code but nothing changed. Is there anything I can fix?

 
<apex:page standardController="Case" renderAs="pdf" applyBodyTag="true">
    <head>
        <style> 
           <apex:stylesheet value="{URLFOR(!$Resource.CasePDF)}"/>
            <apex:includeScript value="{!$Resource.CasePDF}"/>
        </style>
    </head>
    <body>
      <center>
        <h1>Service Work Order</h1>
       <h6>Integrated Precision Systems</h6>
<h6>9321 Ravenna Rd. Suite C. Twinsburg, OH 44087</h6>
       <h6><apex:outputText value="{!Case.CaseNumber}"/> <apex:outputText /></h6>
      </center>
         </body>
    <apex:form ><apex:inputTextarea richText="true"/></apex:form>  <body>
    <left><apex:outputText value="{!Case.Account.Name}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Contact.Name}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Phone__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Address__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Subject}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Description}"/> </left>
    </body>
</apex:page>

 
<apex:page standardController="Case" renderAs="pdf" applyBodyTag="true">
    <head>
        <style> 
            body { font-family: 'Times New Roman Unicode MS'; }
            .companyName { font: bold 30px; color: red; }  
        </style>
    </head>
    <body>
        <center>
        <h1>Service Work Order</h1>
        <h4>Integrated Precision Systems</h4>
        <h6>9321 Ravenna Rd. Suite C. Twinsburg, OH 44087</h6>
      
        </center>
      <left><apex:outputText value="{!Case.CaseNumber}"/> <apex:outputText /></left>
       
         </body>
    <body>
    <left><apex:outputText value="{!Case.Subject}"/> </left>
    
    </body>
    <body>
    <left><apex:outputText value="{!Case.Priority}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Account_Name__c}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Type}"/> </left>
    </body>
    <body>
    <left><apex:outputText value="{!Case.Description}"/> </left>
    </body>
</apex:page>
User-added imagePlease help don't know if there is anything I'm doing wrong or if it is anything that I can fix.
 
<apex:page controller="Calculator"> <apex:form > <apex:inputText value="{!number1}"/> <apex:inputText value="{!number2}"/> <apex:inputText value="{!operator}"/> <apex:commandButton value="Show Result" action="{!calculation}">{!result} </apex:commandbutton> </apex:form> </apex:page>


CONTROLLER

public class Calculator
{
public integer number1{get;set;}
public integer number2{get;set;}
public string operator{get;set;}
public double result{get;set;}
public void calculation()
{
if(operator.contains('+'))
result=number1+number2;
if(operator.contains('-'))
result=number1-number2;
if(operator.contains('*'))
result=number1*number2;
if(operator.contains('/'))
result=number1/number2;
}
}