• shachna
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I have a VF page that renders a PDF based off of a view. The trouble I'm having is I need to have it only render certain Records from the related list assciated with every reocrd. 

 

Code Sample: 

 

<apex:repeat var="cgs15" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cgs15.Therapy_Type__c = 'Oral Motor Therapy', cgs15.RecordType.Name = 'Summary of Outcomes', cgs15.Status__c = 'Active'),True,False)}">
<div>
<h4>{!cgs15.RecordType.Name}</h4>
<p>{!cgs15.Description__c}</p></div>

<p></p><p></p>
</apex:actionRegion>
</apex:repeat>

<apex:repeat var="cg15" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cg15.Therapy_Type__c= 'Oral Motor Therapy', cg15.RecordType.Name = 'Long Term Goal'),True,False)}">

<div><h4>Long Term Goal<br></br></h4>
<hr /><h4>
Status: <span class="plain"><u>{!cg15.Status__c}</u></span>
Start Date: <span class="plain"><apex:outputText value="{0,date,dd MMM yyyy}"><apex:param value="{!cg15.Goal_Start_Date__c}" /></apex:outputText></span>
End Date: <span class="plain"><apex:outputText value="{0,date,dd MMM yyyy}"><apex:param value="{!cg15.Goal_End_Date__c}" /></apex:outputText></span>
</h4>
<p>{!cg15.Description__c}</p></div>
<br></br>

<apex:repeat var="stg15" value="{!cg15.Short_Term_Goals__r}" >
<div> <h4>Short Term Goal <br />
Status:<span class="plain"> {!stg15.STG_Status__c}</span></h4>
<p>{!stg15.STG_Description__c}</p></div>
<br></br>
</apex:repeat>
</apex:actionRegion>
</apex:repeat>

We currently have an old VF page that runs a series 'render' loops to sort reocrds for a PDF. Is there a way to set up the VF page (or possibly use a controller) to sort the records the way I want before running the renderAs='PDF' command so that I'll only need a single loop?

I keep getting an error repot with this error:

 

Encountered unhandled fault when running process Messing_Around_S/

301F00000008Pby exception by user/organization: 00DA00000009S3P/{4}

interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (MALFORMED_ID) Therapy: id value of incorrect type: ABA Assessment ---  for SFDC record with ID : null,

caused by element : Data update.Create_Multiple_2

caused by: interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (MALFORMED_ID) Therapy: id value of incorrect type: ABA Assessment ---  for SFDC record with ID : null,

Salesforce Error ID: 637980083-10856 (1679553335)
 
This flow is designed to create multiple records after the user inputs all the info on a single page. The trouble seems to be with the choice field (ABA Assessment is a choice). The same issue happens no matter what choice I make.

I created a tabbed VF page for a custom object to replace the standard layout that we had. I used this piece of code to call all the related lists I needed.

 

 <apex:tab label="History" name="History" id="tabHistory">
        <apex:relatedList subject="{!Clients__c}" list="OpenActivities"/>
   </apex:tab>

 


The trouble I'm having is I don't know (nor ca I guess) the correct name for the standard History Object that appears in every page. Can anyone tell me what I should be putting in the list
part of the code?

 

Thanks in advance.

I asked about this code a while ago. I have since learned alot about VF proper. I have been able to fix up a lot except that now this code only pulls 20 records. Any help would be appreciated. I just want to say that I didn't write this code to begin with I'm just trying to make heads and tails out of it.

 

 <apex:page showHeader="false" standardController="Clinical_Goals__c" recordSetVar="Clinical_Goals" renderAs="PDF" >
      
      <apex:stylesheet value="{!$Resource.PDFDocumentStyle}" />
  <c:header_doc type="header"></c:header_doc>
    <c:PDFHeaderFooter type="footer" position="left"></c:PDFHeaderFooter>
    <c:PDFHeaderFooter type="footer" position="center">The Donald Berman  <br></br>Centre de Développement YALDEI Developmental Center <br></br> 2100 Marlowe Ave. 5th Floor Montreal, P.Q. H4A 3L5 <br></br> Tel: 514 279 3666   Fax: 514 278 3666</c:PDFHeaderFooter>
    <c:PDFHeaderFooter type="footer" position="right" ></c:PDFHeaderFooter>




 
<p>
<center><h1>INTERVENTION PLAN</h1></center> <br></br><br></br>
<apex:repeat value="{!Clinical_Goals}" var="Titre" rows="1" >

 
Child: {!Titre.Client__r.Name}<br></br>
DOB: {!DAY(Titre.Client__r.Date_of_Birth__c)}/{!MONTH(Titre.Client__r.Date_of_Birth__c)}/{!YEAR(Titre.Client__r.Date_of_Birth__c)}
</apex:repeat>
</p>
 <br></br><br></br>



From here till the word END the code are 2 examples out of 12 (there wasn't enough room to fit them all on but the only thing that changes between them is the Therapy_Type__c =)


<apex:repeat var="cgs12" value="{!Clinical_Goals}">  
<b>The Therapy: '{!cgs12.Therapy_Type__c}' ({!cgs12.RecordType.Name}) </b><br />  
<apex:actionRegion rendered="{!IF(AND(cgs12.Therapy_Type__c = 'Speech Therapy', cgs12.RecordType.Name = 'Summary of Outcomes'),True,False)}">
    <h2>Speech Therapy - {!cgs12.Owner.Name}</h2>
    <table  cellpadding="10" width="99%" border="1">
        <tr>   
            <td  bgcolor="#ffffff"  style="color:#000000">{!cgs12.RecordType.Name}  </td>  
        </tr>  
        <tr>   
            <td bgcolor="#ffffff"  style="color:#000000"> <p>{!cgs12.Description__c}</p> </td>  
        </tr>
    </table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>

     
<apex:repeat var="cg12" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cg12.Therapy_Type__c = 'Speech Therapy', cg12.RecordType.Name = 'Long Term Goal'),True,False)}">
   
   
    <table  cellpadding="10" width="99%" border="1">
        <tr>
        <td bgcolor="#ffffff"  style="color:#000000"><strong>Goal Start Date: </strong>{!DAY(cg12.IP_Period_Start__c)}/{!MONTH(cg12.IP_Period_Start__c)}/{!YEAR(cg12.IP_Period_Start__c)} - <strong>{!cg12.RecordType.Name}</strong> - {!cg12.Name} </td>  
        </tr>
        <tr>   
            <td bgcolor="#ffffff"  style="color:#000000"><b>Description</b> <p>{!cg12.Description__c}</p> </td>  
        </tr>
        <tr>    
            <td bgcolor="#ffffff"  style="color:#000000"><b>Rationale</b> <p>{!cg12.Rationale__c}</p> </td>  
        </tr>   
        <tr>  
            <td bgcolor="#ffffff"  style="color:#000000"><b>Evaluation Methods</b>  <p>{!cg12.Mode_of_Evaluation__c}</p> </td>
        </tr>
        <tr>  
            <td bgcolor="#ffffff"  style="color:#000000">Short term goals</td>
        </tr>
   <apex:repeat var="stg12" value="{!cg12.Short_Term_Goals__r}">
       <tr>   
           <td bgcolor="#ffffff"  style="color:#000000"> {!stg12.Name} - {!stg12.STG_Status__c}   </td>
       </tr>
       <tr>
           <td bgcolor="#ffffff"  style="color:#000000"><p>  <b>Description</b>  <p>{!stg12.STG_Description__c}</p></p> </td>
       </tr>
       <tr>
           <td bgcolor="#ffffff"  style="color:#000000"><p>  <b>Strategies</b><p>{!stg12.Strategies__c}</p></p></td>
       </tr>
    
   </apex:repeat>
   </table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>  





<apex:repeat var="cgs11" value="{!Clinical_Goals}">    
<apex:actionRegion rendered="{!IF(AND(cgs11.Therapy_Type__c = 'Physiotherapy', cgs11.RecordType.Name = 'Summary of Outcomes'),True,False)}">
<h2>Physiotherapy - {!cgs11.Owner.Name}</h2>    
    <table  cellpadding="10" width="99%" border="1">
        <tr>   
            <td bgcolor="#ffffff"  style="color:#000000">{!cgs11.RecordType.Name} ({!cgs11.IP_Period__c})  </td>  
        </tr>  
        <tr>   
            <td bgcolor="#ffffff"  style="color:#000000"> <p>{!cgs11.Description__c}</p> </td>  
        </tr>
    </table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>
     
<apex:repeat var="cg11" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cg11.Therapy_Type__c = 'Physiotherapy', cg11.RecordType.Name = 'Long Term Goal'),True,False)}">
    <table  cellpadding="10" width="99%" border="1">
        <tr>
        <td bgcolor="#ffffff"  style="color:#000000"><strong>Goal Start Date: </strong>{!DAY(cg11.IP_Period_Start__c)}/{!MONTH(cg11.IP_Period_Start__c)}/{!YEAR(cg11.IP_Period_Start__c)} - <strong>{!cg11.RecordType.Name}</strong> - {!cg11.Name} </td>  
        </tr>
        <tr>   
            <td bgcolor="#ffffff"  style="color:#000000"><b>Description</b> <p>{!cg11.Description__c}</p> </td>  
        </tr>
        <tr>    
            <td bgcolor="#ffffff"  style="color:#000000"><b>Rationale</b> <p>{!cg11.Rationale__c}</p> </td>  
        </tr>   
        <tr>  
            <td bgcolor="#ffffff"  style="color:#000000"><b>Evaluation Methods</b>  <p>{!cg11.Mode_of_Evaluation__c}</p> </td>
        </tr>
        <tr>  
            <td bgcolor="#ffffff"  style="color:#000000">Short term goals</td>
        </tr>
   <apex:repeat var="stg11" value="{!cg11.Short_Term_Goals__r}">
       <tr>   
           <td bgcolor="#ffffff"  style="color:#000000"> {!stg11.Name} - {!stg11.STG_Status__c}   </td>
       </tr>
       <tr>
           <td bgcolor="#ffffff"  style="color:#000000"><p>  <b>Description</b>  <p>{!stg11.STG_Description__c}</p></p> </td>
       </tr>
       <tr>
           <td bgcolor="#ffffff"  style="color:#000000"><p>  <b>Strategies</b><p>{!stg11.Strategies__c}</p></p></td>
       </tr>
    
   </apex:repeat>
   </table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>  


END


<apex:repeat value="{!Clinical_Goals}" var="sup" rows="1">
<br></br><br></br><br></br>
_____________________________<br></br>                                         
{!sup.Client__r.Supervisor__r.Name}<br></br>  
Clinical Supervisor<br></br>
</apex:repeat>
<br></br>
_____________________________<br></br>                                         
Benyamin Baer<br></br>  
Director Of clinical Services<br></br>  
 
   
 
</apex:page>

I'm new to Visualforce, but was given a fully running web site to maintain. I'm trying to make a small change to a visualforce page that  produces a PDF. I understood all the formatting language, but I'm stuck on this line (See red lines below). 

 

<apex:repeat var="cgs12" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cgs12.Therapy_Type__c = 'Speech Therapy', cgs12.RecordType.Name = 'Summary of Outcomes From Previous IP Period'),True,False)}">
<h2>Speech Therapy - {!cgs12.Owner.Name}</h2>
<table cellpadding="10" width="99%" border="1">
<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_Period_Start__c}) </td>
</tr>
<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_PERIOD_END__c}) </td>
</tr>
<tr>
<td bgcolor="#ffffff" style="color:#000000"> <p>{!cgs12.Description__c}</p> </td>
</tr>
</table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>

 

The line orignally looked like this:

<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_Period__c}) </td>
</tr>

 

The trouble was that it was a picklist and I needed to change it to a start date and end date. But now the dates don't show up on the PDF. What am I doing wrong?

 

Ran a Debug Log this is the result:

 

21.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
11:52:15.032 (32506000)|EXECUTION_STARTED
11:52:15.032 (32551000)|CODE_UNIT_STARTED|[EXTERNAL]|066F0000001TbyJ|VF: /apex/clinical_goalsM1
11:52:15.866 (250054000)|CUMULATIVE_LIMIT_USAGE
11:52:15.866|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 4 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of script statements: 0 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

11:52:15.866|CUMULATIVE_LIMIT_USAGE_END

11:52:15.250 (250099000)|CODE_UNIT_FINISHED|VF: /apex/clinical_goalsM1
11:52:15.250 (250110000)|EXECUTION_FINISHED

 

I have a VF page that renders a PDF based off of a view. The trouble I'm having is I need to have it only render certain Records from the related list assciated with every reocrd. 

 

Code Sample: 

 

<apex:repeat var="cgs15" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cgs15.Therapy_Type__c = 'Oral Motor Therapy', cgs15.RecordType.Name = 'Summary of Outcomes', cgs15.Status__c = 'Active'),True,False)}">
<div>
<h4>{!cgs15.RecordType.Name}</h4>
<p>{!cgs15.Description__c}</p></div>

<p></p><p></p>
</apex:actionRegion>
</apex:repeat>

<apex:repeat var="cg15" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cg15.Therapy_Type__c= 'Oral Motor Therapy', cg15.RecordType.Name = 'Long Term Goal'),True,False)}">

<div><h4>Long Term Goal<br></br></h4>
<hr /><h4>
Status: <span class="plain"><u>{!cg15.Status__c}</u></span>
Start Date: <span class="plain"><apex:outputText value="{0,date,dd MMM yyyy}"><apex:param value="{!cg15.Goal_Start_Date__c}" /></apex:outputText></span>
End Date: <span class="plain"><apex:outputText value="{0,date,dd MMM yyyy}"><apex:param value="{!cg15.Goal_End_Date__c}" /></apex:outputText></span>
</h4>
<p>{!cg15.Description__c}</p></div>
<br></br>

<apex:repeat var="stg15" value="{!cg15.Short_Term_Goals__r}" >
<div> <h4>Short Term Goal <br />
Status:<span class="plain"> {!stg15.STG_Status__c}</span></h4>
<p>{!stg15.STG_Description__c}</p></div>
<br></br>
</apex:repeat>
</apex:actionRegion>
</apex:repeat>

We currently have an old VF page that runs a series 'render' loops to sort reocrds for a PDF. Is there a way to set up the VF page (or possibly use a controller) to sort the records the way I want before running the renderAs='PDF' command so that I'll only need a single loop?

I keep getting an error repot with this error:

 

Encountered unhandled fault when running process Messing_Around_S/

301F00000008Pby exception by user/organization: 00DA00000009S3P/{4}

interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (MALFORMED_ID) Therapy: id value of incorrect type: ABA Assessment ---  for SFDC record with ID : null,

caused by element : Data update.Create_Multiple_2

caused by: interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (MALFORMED_ID) Therapy: id value of incorrect type: ABA Assessment ---  for SFDC record with ID : null,

Salesforce Error ID: 637980083-10856 (1679553335)
 
This flow is designed to create multiple records after the user inputs all the info on a single page. The trouble seems to be with the choice field (ABA Assessment is a choice). The same issue happens no matter what choice I make.

I created a tabbed VF page for a custom object to replace the standard layout that we had. I used this piece of code to call all the related lists I needed.

 

 <apex:tab label="History" name="History" id="tabHistory">
        <apex:relatedList subject="{!Clients__c}" list="OpenActivities"/>
   </apex:tab>

 


The trouble I'm having is I don't know (nor ca I guess) the correct name for the standard History Object that appears in every page. Can anyone tell me what I should be putting in the list
part of the code?

 

Thanks in advance.

I'm new to Visualforce, but was given a fully running web site to maintain. I'm trying to make a small change to a visualforce page that  produces a PDF. I understood all the formatting language, but I'm stuck on this line (See red lines below). 

 

<apex:repeat var="cgs12" value="{!Clinical_Goals}">
<apex:actionRegion rendered="{!IF(AND(cgs12.Therapy_Type__c = 'Speech Therapy', cgs12.RecordType.Name = 'Summary of Outcomes From Previous IP Period'),True,False)}">
<h2>Speech Therapy - {!cgs12.Owner.Name}</h2>
<table cellpadding="10" width="99%" border="1">
<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_Period_Start__c}) </td>
</tr>
<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_PERIOD_END__c}) </td>
</tr>
<tr>
<td bgcolor="#ffffff" style="color:#000000"> <p>{!cgs12.Description__c}</p> </td>
</tr>
</table><p></p><p></p>
</apex:actionRegion>
</apex:repeat>

 

The line orignally looked like this:

<tr>
<td bgcolor="#ffffff" style="color:#000000">{!cgs12.RecordType.Name} ({!cgs12.IP_Period__c}) </td>
</tr>

 

The trouble was that it was a picklist and I needed to change it to a start date and end date. But now the dates don't show up on the PDF. What am I doing wrong?

 

Ran a Debug Log this is the result:

 

21.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
11:52:15.032 (32506000)|EXECUTION_STARTED
11:52:15.032 (32551000)|CODE_UNIT_STARTED|[EXTERNAL]|066F0000001TbyJ|VF: /apex/clinical_goalsM1
11:52:15.866 (250054000)|CUMULATIVE_LIMIT_USAGE
11:52:15.866|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 4 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of script statements: 0 out of 200000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

11:52:15.866|CUMULATIVE_LIMIT_USAGE_END

11:52:15.250 (250099000)|CODE_UNIT_FINISHED|VF: /apex/clinical_goalsM1
11:52:15.250 (250110000)|EXECUTION_FINISHED

 

Problem:

 

You have a VF page that you want to output as Excel but the line breaks in your TextArea fields cause Excel to create new rows at each line break rather than preserve the line breaks within the cell as if you had used ALT-ENTER (or your line breaks are lost altogether and the text is run on with no breaks)

 

Example:

 

SFDC TextArea field contains:

"Line 1

Line 2"

 

(or "Line 1\nLine 2")

 

Your output in Excel should be one row with the cell preserving the line breaks but you either:

 

a) get two rows, broken at the line break

b) one row but the line break is lost and the text is run-on

 

Solution follows in the next post