Configuring Cover Sheets
Overview
Cover sheets can be configured for Essays, Extracurricular, Recommendations and Enrollment History components. These can be useful to set some context for your reviewers. In addition, cover sheets will display the relevant information for records that do not include an attachment (e.g., an essay typed into a text field, recommendation information typed into a recommendation form, etc.). For example, a cover sheet for an Essay might include the Title, Topic, and Student Name.
- Go to Setup and select Object Manager.
- Search for the custom object for which you want a Cover Sheet. For example, Essay (TargetX_SRMb__Essay__c).
- Click the object and navigate to Field Sets.
- Click Edit for the Essay Cover Sheet.
- Drag new fields into the Field Set or remove any fields as needed.
Creating Custom Cover Sheets using Visualforce Pages
The following steps will detail how to create custom Cover Sheets that can be included in the Application PDF for Application reviewers. In the following example, you’ll create a custom cover sheet for the Test object, available in the TargetX Recruitment Manager package.
Create a FieldSet
The Application Review Tool uses Salesforce FieldSets in cover sheets to make it easier to add and remove fields on the cover sheet.
- Go to Setup and select Object Manager. In this example, we will be using the Test object.
- Go to the Field Sets related list:
- Click New and set the following fields:
- Field Set Label
- Field Set Name
- Where is this used?
- Click Save and add fields to fieldset.
- Save and now your Field Set is ready for use.
Create a custom Visualforce Page
- From Setup and search for Visualforce Pages
- Select New.
- Set a Name and Label for page.
- Copy and paste the following code, then make changes to the portions of the code marked in bold as appropriate. (Use the view source icon at the top right to copy the code.) Or you can download the code here:
<apex:page standardController="<<insert the api name of object>>" showHeader="false" applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false"> <head> <style type="text/css"> @page { margin-top: 100px; margin-bottom: 100px; } </style> </head> <body> <div> <h2><<insert some title>></h2> <table width="100%" cellpadding="5px" cellspacing="5px"> <tbody> <apex:repeat value="{!$ObjectType.<<insert the api name of object>>.FieldSets.<<insert field set name>>}" var="field"> <tr> <td><b>{!field.label}</b></td> </tr> <tr> <td><apex:outputtext style="white-space:pre-wrap;font-family:Helvetica, Arial Unicode MS, sans-serif;"" value="{!<<insert the api name of object>>[field.fieldPath]}"/></td> </tr> </apex:repeat> </tbody> </table> </div> </body> </apex:page>
As per our example, it becomes:
<apex:page standardController=" TargetX_SRMb__Test__c" showHeader="false" applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false"> <head> <style type="text/css"> @page { margin-top: 100px; margin-bottom: 100px; } </style> </head> <body> <div> <h2> Test (GRE)</h2> <table width="100%" cellpadding="5px" cellspacing="5px"> <tbody> <apex:repeat value="{!$ObjectType. TargetX_SRMb__Test__c.FieldSets. GRE_Cover_Sheet}" var="field"> <tr> <td><b>{!field.label}</b></td> </tr> <tr> <td><apex:outputtext style="white-space:pre-wrap;font-family:Helvetica, Arial Unicode MS, sans-serif;" value="{!TargetX_SRMb__Test__c[field.fieldPath]}"/></td> </tr> </apex:repeat> </tbody> </table> </div> </body> </apex:page>
- Save, and your visualforce page is ready to use.
- You can update the 'Date Format' if you want dates displayed as MM/DD/YYYY.
- Select the Custom Cover Sheet in the Doc Definition window.
- Save and continue.
Rendering line breaks in your Custom Coversheet
- Navigate to Setup and search for Visualforce Pages.
- Locate your custom cover sheet and select Edit.
- Replace the following:
<td>{!TargetX_SRMb__Recommendation__c[field.fieldPath]}<td/>
With
<apex:outputtext style="white-space:pre-wrap;font-family:Helvetica, Arial Unicode MS, sans-serif;" value="{!<<insert the api name of object>>[field.fieldPath]}"/>
- Save your changes.
Updating the 'Date Format' in your Custom Coversheet
- Navigate to Setup and search for Visualforce Pages.
- Locate your Custom Coversheet and select Edit.
- In the Visualforce Markup tab, search for field.fieldpath for the object you want to update the date format:
<apex: outputtext style "white-space:pre-wrap; font-family:Helvetica, Arial Unicode MS, sans-serif;" value " {!Target_SRMb_Enrollment_History_c[field.fieldPath]}"/>
- Replace that line with the following, replacing the field name as needed:
<apex: outputtext style "white-space:pre-wrap; font-family:Helvetica, Arial Unicode MS, sans-serif;" value "{!IF (field. Type ='date , ' (0, date, MM/dd/yyyy) ', ' (0)') )" > {f <apex:param value-" (!Target_SRMb_Enrollment_History_c[field.fieldPath])" />}) </apex: outputText>
- Save your changes.