• Jskin
  • NEWBIE
  • 60 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 14
    Replies
Hi,

We have a number of VF pages in our system which have a hardcoded reference to an address.   The address should be displayed differently dependant on region.   If there is an update to the address, we need to updat all the VF pages so I wanted to move the addresses into a component and reference the component from the VF pages.

To avoid using a controller, I am trying to set the logic in the VF page so that an attribute for the component is set to the correct region if the conditions are met:

----page----
<apex:outputpanel rendered="{!IF((Enrollment__c.Translation_Formula__c = 'China (Chinese)')&&(CONTAINS(Enrollment__c.Training_Event__r.China_Region__c, 'SW')),true,false)}">
        <c:ChinaContactsText region="SW"/>
</apex:outputpanel>
<apex:outputpanel rendered="{!IF((Enrollment__c.Translation_Formula__c = 'China (Chinese)')&&(Enrollment__c.Training_Event__r.China_Region__c = "SC:SZ"),true,false)}">
        <c:ChinaContactsText region="SC:SZ"/>
    </apex:outputpanel>

----component----
<apex:component access="global">

<apex:attribute name="region" type="string" description="regional contact" />
  
  <apex:outputText rendered="{!IF(region='SW',true,false)">
        <br/>地区 : 重庆 SW
        <br/>联系人 : Blair Chat(陈鹏博)
        <br/>电话 : +96 (0)43 6338 1111  
  </apex:outputText>
  <apex:outputText rendered="{!IF(region='SW',false,true)"> 
      not SW 
  </apex:outputText>
</apex:component>
   
However nothing gets displayed.   Is what I am trying even possible?  If so, what is the correct markup to use/try for the component?  Or is there another way to do this?
Thanks!
  • October 02, 2017
  • Like
  • 0

Hi,

 

My knowledge on coding is very basic so I am not sure it is possble to do what I'd like or if I have to find an alternate solution.   Basically I am rendering a pdf which lists of of the delegates who have attended a training course and stating if they have passed or failed. 

 

I am doing this in a pdf attachment to an email.  I had it working fine until I found a course with 30+ delegates as the table just continues to render over the page footer and beyond.  Is there anyway to easily split this table after 30 entries (I would like to avoid anything creating controllers etc as they are over my head)?

 

This is my code (the red section is the data table):

 

<messaging:attachment renderAs="pdf"  filename="Exam results notification">
<html>
<head><style type="text/css" media="print">
body {color:#666666; font-family:"Arial Unicode MS"; font-size:11pt; font-style:normal; }

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

div.footer {
   display: block;
   position: running(footer);
   line-height: 10pt;
   font-size: 7.5pt;
   color: #A9A9A9;
   z-index:2;                
}
   
</style>
</head>

<body>


<img src="{!URLFOR($Resource.Template)}" style="position: fixed; left: 0cm; top: 0cm;  z-index:-2;" width="21cm" height="29.7"/>

 <apex:dataTable cellpadding="2" width="15.92cm" border="0.2" style=" text-align:center; position: fixed; left: 2.54cm; top: 8cm; line-height: 12pt; font-size:11pt; z-index:+2;" columns="5" value="{!relatedTo.Enrollments__r}" var="cx" >

               <apex:column width="3cm"  >  
                   <apex:facet name="header">Number</apex:facet>
                       {!cx.name}       
               </apex:column>
               <apex:column >
                      <apex:facet name="header">姓名</apex:facet>
                             {!cx.delegate_name__r.LastNameLocal}{!cx.delegate_name__r.FirstNameLocal}
               </apex:column>
               <apex:column >
                      <apex:facet name="header">單位</apex:facet>
                          {!cx.delegate_name__r.department}     
               </apex:column>
               <apex:column >
                     <apex:facet name="header">英文姓名</apex:facet>
                         {!cx.delegate_name__r.LastName}{!cx.delegate_name__r.FirstName}
               </apex:column>
               <apex:column width="2cm" >
                   <apex:facet name="header">Pass/Fail</apex:facet>
                       {!IF(OR(CONTAINS(cx.Exam_results__c,'Fail'),CONTAINS(cx.Exam_results__c,'fail')),'F','P')}
               </apex:column>
               
        </apex:dataTable>



<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm; line-height: 10pt; font-size:7.5pt; color: #A9A9A9;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>
address
</td>
<td>address</td>
<td></td>
<td></td>
</tr>
</table>
</body></html>
</messaging:attachment>

 

Many Thanks for any help you can offer.

 

  • December 19, 2012
  • Like
  • 0

Apologies I know this has been covered several times in the forum but I have been trying out the code/suggestions for the other posts but can't seem to apply it to my situation.  I am trying render a pdf attachement to an email to show a list on one page and an image on the next.  Both pages have a background image from Static resources on them.  I have managed to get the PDF to split into 2 pages but the list and image appear together on both pages.  Any suggestions on how I can alter my following code to fix this?  Many Thanks.

 

 

<messaging:attachment renderAs="pdf" filename="Venue Specifications">
<html><head>
<style type="text/css" media="print">

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

p
{
color:#666666;
font-family:"Arial Unicode MS";
font-size:10pt;
}

h3
{
color:#E52013;
font-family:"Arial Unicode MS";
font-size:11pt;
font-style:bold;
}

footer
{
color:#A9A9A9;
font-family:"Arial Unicode MS";
font-size:7.5pt;
}
</style>

</head>


<img src="{!URLFOR($Resource.Document_New)}" style="position: fixed; left: 0cm; top:0cm;  z-index:-1" width="21cm" height="29.7"/>

<table style="position: fixed; left: 2.54cm; top:4.25cm; width:16.02cm; height:21.2cm;" border="0.1">
<tr><td>
<b><h3>VENUE SPECIFICATIONS:</h3></b>
<ol>
<li><p>Numbered list.</p></li>
<li>....</li>
</ol>
<p>If you have any difficulties in meeting these requirements please contact us as soon as possible. </p>
</td></tr></table>

<footer>
<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>Office Address<br/>Street<br/></td>
<td></td>
<td></td>
</tr>
</table>
</footer>

<div style="page-break-before:always">
<img src="{!URLFOR($Resource.Document_New)}" style="position: fixed; left: 0cm; top:0cm;  z-index:-1" width="21cm" height="29.7"/>

<apex:image style="position: fixed; left: 4cm; top:8cm;"  url="https://cs7.salesforce.com/servlet/servlet.ImageServer?id=........"/>
</div>
</html>
</messaging:attachment>


  • August 10, 2012
  • Like
  • 0

Hi,

 

We have an application we have built on our platform for managing our training business.  We use one object to produce a certificate for delegates after the course.  The certificate displays a signature and sometimes a logo dependant on the course.  We store these images in "Documents" which we make externally avaiblable and use the <apex:image> componenet to display.  This was working fine up until today.  Today for some reason none of the images will display in the pdfs.  I cannot see any changes to the code or the links we have been using - was there any changes made to the Salesforce platform last night which could effect this?  Has anyone else seen this issue?

 

The line of code we use is:

 

<apex:image height="1.3cm" url="https://eu1.salesforce.com/servlet/servlet.ImageServer?id=015D0000001Fs3o&oid=00D200000000Evl" />

 

https://eu1.salesforce.com/servlet/servlet.ImageServer?id=015D0000001Fs3o&oid=00D200000000Evl

 

I would approach support but I've be told in the past that with our service level they do not support VF.

 

Many Thanks.

Julie

 

  • July 26, 2012
  • Like
  • 0

Hi,

 

I'm looking to change a visualforce page that we render as a pdf to display in a different font.  The page displays multiple languages with different characters - Japanese, Chinese aswell as English.   So far I have only been able to get the page to render correctly by using Arial Unicode MS (see code below).  We have a need to use Tahoma instead but the page won't display the non english characters.  Any suggestions?  Many Thanks.

 

<apex:page renderAs="pdf" standardController="Enrollment__c" showHeader="false" pageStyle="all">
<head>
<style type="text/css" media="print">


body{    
    font-family: Arial Unicode MS;
        }

@page{
    @bottom-center {                               
    }
    @bottom-left {                  
    content: element(footer);      
    }
    size: A4 portrait;
    margin-top:.0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:2.1cm;
          
}

  • March 02, 2012
  • Like
  • 0

We have an application we use to manage events and the attendees(enrolments).  I have created a simple VF page which displays a list of the attendees for an event and allows you to select whether to print or email a certificate for them.  

 

I would like to develop this further in 2 ways:

 

1. have a tickbox at the top to "select all" the attendees for either printing or email the certificate.  I want to stick with the 2 columns as it lets me keep to my simple workflows instead of further code (I'm not a developer)

 

2.from the selected attendees generate a PDF with all the selected attendee certificates in one pdf document (I currently can only review one at a time.

 

 

For the first part:

 

I have managed to get one "select all" box working from research on this site but am unsure how to do a second - anything I have tried just selects the same fields.  Code is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates" />
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://cs7.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                                              
                        <apex:column >
                           <apex:facet name="header">
                                <apex:outputPanel >
                                    <apex:outputLabel value="Cert Printed?" for="Select_All_Print"/>
                                    <apex:inputCheckbox onclick="checkAll(this)" id="Select_All_Print"/>
                                </apex:outputPanel>
                           </apex:facet>
                          <apex:inputField id="Selectd_Print" value="{!Enrollment.Certificate_Printed__c}"/>
                        </apex:column>
                                             
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
                                                                      
              </apex:pageBlockSection>
          <apex:outputlink target="_blank" value="https://cs7.salesforce.com/apex/ReviewPDFcertList?id={!selected}">Review all selected Certificates</apex:outputlink>
                                           
        </apex:pageBlock>
    </apex:form>
   
    <script type="text/javascript">
      function checkAll(cb)
        {
            var inputElem = document.getElementsByTagName("input");          
            for(var i=0; i<inputElem.length; i++)
            {   
                 if(inputElem[i].id.indexOf("Selectd_Print")!=-1)                         
                inputElem[i].checked = cb.checked;
            }
        }
</script>
        
</apex:page>

 

 

Then my second issue is really what variable or id I can use to generate all the PDFs for the individual I have been using

 

..../apex/ReviewPDFcert?id={!Enrollment.id}

 

My VF page "ReveiwPDFcert" picks up the enrolment and creates a simple certificate.    I am not sure what to replace the   id={enrollment.id} with or on the pdf page,    <apex:page renderAs="pdf" standardController="Enrollment__c" showHeader="false" pageStyle="all">, what to use as the variable (I know I want it to show all of the attendees who have Enrollment.Certificate_Printed__c selected as per above).

 

Any help offered on this would be gratefully received - custom controllers and extensions are still beyond me.  Many Thanks.

 

 

 

 

 

  • February 09, 2012
  • Like
  • 0

We have a custom app set up on our system with the customer objects Training Events and Enrolments.  An enrolment links an Opportunity to a Contact and the training event and appears as a related list on the training event.  I have created a few VF pages with Enrolment as the standard controller which are accessed via a custom button on the related list on Training Event page. 

 

The idea is that relevant enrolments are selected and when the VF page is access they can all be edited in one go and the changes saved.  IN the last few weeks I am continually receiving the following error message when I click save:

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 166244247-41322 (-259332223)

 

This has only started happening recently (around the time Spring 12 was released to our Sandbox) and SFDC seem to be unable to support as is it a developer issue.  The code has not been altered at all and still works perfectly in production.  Does anyone know if there could be something in Spring 12 whcih is causing this?

 

The basic code for the pages is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates"/>
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcertnoback?id={!Enrollment.id}">review pdf no background</apex:outputlink><br/>         
                       <apex:outputlink rendered="{!IF((CONTAINS($Profile.Name, "System")||(CONTAINS($Profile.Name, "Japan"))),TRUE, FALSE)}"   target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert_Japan?id={!Enrollment.id}">Japan certificate (except IRCA)</apex:outputlink><br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/coverletter?id={!Enrollment.id}">coverletter</apex:outputlink></apex:column>
                       <apex:column headerValue="Cert Printed?"><apex:inputField value="{!Enrollment.Certificate_Printed__c}"/></apex:column>
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
              </apex:pageBlockSection>                        
        </apex:pageBlock>
    </apex:form>    
</apex:page>

 

 

Many Thanks for any help anyone can offer on this - I am new to development.

 

  • February 01, 2012
  • Like
  • 0

Hi,

 

My knowledge on coding is very basic so I am not sure it is possble to do what I'd like or if I have to find an alternate solution.   Basically I am rendering a pdf which lists of of the delegates who have attended a training course and stating if they have passed or failed. 

 

I am doing this in a pdf attachment to an email.  I had it working fine until I found a course with 30+ delegates as the table just continues to render over the page footer and beyond.  Is there anyway to easily split this table after 30 entries (I would like to avoid anything creating controllers etc as they are over my head)?

 

This is my code (the red section is the data table):

 

<messaging:attachment renderAs="pdf"  filename="Exam results notification">
<html>
<head><style type="text/css" media="print">
body {color:#666666; font-family:"Arial Unicode MS"; font-size:11pt; font-style:normal; }

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

div.footer {
   display: block;
   position: running(footer);
   line-height: 10pt;
   font-size: 7.5pt;
   color: #A9A9A9;
   z-index:2;                
}
   
</style>
</head>

<body>


<img src="{!URLFOR($Resource.Template)}" style="position: fixed; left: 0cm; top: 0cm;  z-index:-2;" width="21cm" height="29.7"/>

 <apex:dataTable cellpadding="2" width="15.92cm" border="0.2" style=" text-align:center; position: fixed; left: 2.54cm; top: 8cm; line-height: 12pt; font-size:11pt; z-index:+2;" columns="5" value="{!relatedTo.Enrollments__r}" var="cx" >

               <apex:column width="3cm"  >  
                   <apex:facet name="header">Number</apex:facet>
                       {!cx.name}       
               </apex:column>
               <apex:column >
                      <apex:facet name="header">姓名</apex:facet>
                             {!cx.delegate_name__r.LastNameLocal}{!cx.delegate_name__r.FirstNameLocal}
               </apex:column>
               <apex:column >
                      <apex:facet name="header">單位</apex:facet>
                          {!cx.delegate_name__r.department}     
               </apex:column>
               <apex:column >
                     <apex:facet name="header">英文姓名</apex:facet>
                         {!cx.delegate_name__r.LastName}{!cx.delegate_name__r.FirstName}
               </apex:column>
               <apex:column width="2cm" >
                   <apex:facet name="header">Pass/Fail</apex:facet>
                       {!IF(OR(CONTAINS(cx.Exam_results__c,'Fail'),CONTAINS(cx.Exam_results__c,'fail')),'F','P')}
               </apex:column>
               
        </apex:dataTable>



<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm; line-height: 10pt; font-size:7.5pt; color: #A9A9A9;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>
address
</td>
<td>address</td>
<td></td>
<td></td>
</tr>
</table>
</body></html>
</messaging:attachment>

 

Many Thanks for any help you can offer.

 

  • December 19, 2012
  • Like
  • 0

Apologies I know this has been covered several times in the forum but I have been trying out the code/suggestions for the other posts but can't seem to apply it to my situation.  I am trying render a pdf attachement to an email to show a list on one page and an image on the next.  Both pages have a background image from Static resources on them.  I have managed to get the PDF to split into 2 pages but the list and image appear together on both pages.  Any suggestions on how I can alter my following code to fix this?  Many Thanks.

 

 

<messaging:attachment renderAs="pdf" filename="Venue Specifications">
<html><head>
<style type="text/css" media="print">

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

p
{
color:#666666;
font-family:"Arial Unicode MS";
font-size:10pt;
}

h3
{
color:#E52013;
font-family:"Arial Unicode MS";
font-size:11pt;
font-style:bold;
}

footer
{
color:#A9A9A9;
font-family:"Arial Unicode MS";
font-size:7.5pt;
}
</style>

</head>


<img src="{!URLFOR($Resource.Document_New)}" style="position: fixed; left: 0cm; top:0cm;  z-index:-1" width="21cm" height="29.7"/>

<table style="position: fixed; left: 2.54cm; top:4.25cm; width:16.02cm; height:21.2cm;" border="0.1">
<tr><td>
<b><h3>VENUE SPECIFICATIONS:</h3></b>
<ol>
<li><p>Numbered list.</p></li>
<li>....</li>
</ol>
<p>If you have any difficulties in meeting these requirements please contact us as soon as possible. </p>
</td></tr></table>

<footer>
<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>Office Address<br/>Street<br/></td>
<td></td>
<td></td>
</tr>
</table>
</footer>

<div style="page-break-before:always">
<img src="{!URLFOR($Resource.Document_New)}" style="position: fixed; left: 0cm; top:0cm;  z-index:-1" width="21cm" height="29.7"/>

<apex:image style="position: fixed; left: 4cm; top:8cm;"  url="https://cs7.salesforce.com/servlet/servlet.ImageServer?id=........"/>
</div>
</html>
</messaging:attachment>


  • August 10, 2012
  • Like
  • 0

Hi,

 

We have an application we have built on our platform for managing our training business.  We use one object to produce a certificate for delegates after the course.  The certificate displays a signature and sometimes a logo dependant on the course.  We store these images in "Documents" which we make externally avaiblable and use the <apex:image> componenet to display.  This was working fine up until today.  Today for some reason none of the images will display in the pdfs.  I cannot see any changes to the code or the links we have been using - was there any changes made to the Salesforce platform last night which could effect this?  Has anyone else seen this issue?

 

The line of code we use is:

 

<apex:image height="1.3cm" url="https://eu1.salesforce.com/servlet/servlet.ImageServer?id=015D0000001Fs3o&oid=00D200000000Evl" />

 

https://eu1.salesforce.com/servlet/servlet.ImageServer?id=015D0000001Fs3o&oid=00D200000000Evl

 

I would approach support but I've be told in the past that with our service level they do not support VF.

 

Many Thanks.

Julie

 

  • July 26, 2012
  • Like
  • 0

Hi,

 

I'm looking to change a visualforce page that we render as a pdf to display in a different font.  The page displays multiple languages with different characters - Japanese, Chinese aswell as English.   So far I have only been able to get the page to render correctly by using Arial Unicode MS (see code below).  We have a need to use Tahoma instead but the page won't display the non english characters.  Any suggestions?  Many Thanks.

 

<apex:page renderAs="pdf" standardController="Enrollment__c" showHeader="false" pageStyle="all">
<head>
<style type="text/css" media="print">


body{    
    font-family: Arial Unicode MS;
        }

@page{
    @bottom-center {                               
    }
    @bottom-left {                  
    content: element(footer);      
    }
    size: A4 portrait;
    margin-top:.0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:2.1cm;
          
}

  • March 02, 2012
  • Like
  • 0

We have an application we use to manage events and the attendees(enrolments).  I have created a simple VF page which displays a list of the attendees for an event and allows you to select whether to print or email a certificate for them.  

 

I would like to develop this further in 2 ways:

 

1. have a tickbox at the top to "select all" the attendees for either printing or email the certificate.  I want to stick with the 2 columns as it lets me keep to my simple workflows instead of further code (I'm not a developer)

 

2.from the selected attendees generate a PDF with all the selected attendee certificates in one pdf document (I currently can only review one at a time.

 

 

For the first part:

 

I have managed to get one "select all" box working from research on this site but am unsure how to do a second - anything I have tried just selects the same fields.  Code is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates" />
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://cs7.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                                              
                        <apex:column >
                           <apex:facet name="header">
                                <apex:outputPanel >
                                    <apex:outputLabel value="Cert Printed?" for="Select_All_Print"/>
                                    <apex:inputCheckbox onclick="checkAll(this)" id="Select_All_Print"/>
                                </apex:outputPanel>
                           </apex:facet>
                          <apex:inputField id="Selectd_Print" value="{!Enrollment.Certificate_Printed__c}"/>
                        </apex:column>
                                             
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
                                                                      
              </apex:pageBlockSection>
          <apex:outputlink target="_blank" value="https://cs7.salesforce.com/apex/ReviewPDFcertList?id={!selected}">Review all selected Certificates</apex:outputlink>
                                           
        </apex:pageBlock>
    </apex:form>
   
    <script type="text/javascript">
      function checkAll(cb)
        {
            var inputElem = document.getElementsByTagName("input");          
            for(var i=0; i<inputElem.length; i++)
            {   
                 if(inputElem[i].id.indexOf("Selectd_Print")!=-1)                         
                inputElem[i].checked = cb.checked;
            }
        }
</script>
        
</apex:page>

 

 

Then my second issue is really what variable or id I can use to generate all the PDFs for the individual I have been using

 

..../apex/ReviewPDFcert?id={!Enrollment.id}

 

My VF page "ReveiwPDFcert" picks up the enrolment and creates a simple certificate.    I am not sure what to replace the   id={enrollment.id} with or on the pdf page,    <apex:page renderAs="pdf" standardController="Enrollment__c" showHeader="false" pageStyle="all">, what to use as the variable (I know I want it to show all of the attendees who have Enrollment.Certificate_Printed__c selected as per above).

 

Any help offered on this would be gratefully received - custom controllers and extensions are still beyond me.  Many Thanks.

 

 

 

 

 

  • February 09, 2012
  • Like
  • 0

We have a custom app set up on our system with the customer objects Training Events and Enrolments.  An enrolment links an Opportunity to a Contact and the training event and appears as a related list on the training event.  I have created a few VF pages with Enrolment as the standard controller which are accessed via a custom button on the related list on Training Event page. 

 

The idea is that relevant enrolments are selected and when the VF page is access they can all be edited in one go and the changes saved.  IN the last few weeks I am continually receiving the following error message when I click save:

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 166244247-41322 (-259332223)

 

This has only started happening recently (around the time Spring 12 was released to our Sandbox) and SFDC seem to be unable to support as is it a developer issue.  The code has not been altered at all and still works perfectly in production.  Does anyone know if there could be something in Spring 12 whcih is causing this?

 

The basic code for the pages is as follows:

 

<apex:page standardController="Enrollment__c" recordSetVar="Enrollments" sidebar="false">
    <apex:sectionHeader title="Email/Print Certificates"/>
        <apex:form >
          <apex:pageBlock >
             <apex:pageMessages />
                <apex:pageBlockButtons >
                    <apex:commandButton value="Save/Send Email" action="{!save}" />
                    <apex:commandButton value="Cancel" action="{!cancel}" />
                </apex:pageBlockButtons>
             <apex:pageBlockSection title="Selected Enrollments" columns="1" collapsible="False">
                    <apex:pageBlockTable value="{!selected}" var="Enrollment">
                       <apex:column value="{!Enrollment.name}"/>
                       <apex:column value="{!Enrollment.Delegate_name__c}"/>
                       <apex:column value="{!Enrollment.Booking_status__c}"/>
                       <apex:column value="{!Enrollment.Invoice_status__c}"/>
                       <apex:column value="{!Enrollment.Exam_results__c}"/>
                       <apex:column value="{!Enrollment.Exam_percentage__c}"/>
                       <apex:column value="{!Enrollment.Hold_Certificate__c}"/>
                       <apex:column value="{!Enrollment.Certificate_status__c}"/>
                       <apex:column headerValue="Review PDF/Open to print">
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert?id={!Enrollment.id}">review pdf</apex:outputlink> <br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcertnoback?id={!Enrollment.id}">review pdf no background</apex:outputlink><br/>         
                       <apex:outputlink rendered="{!IF((CONTAINS($Profile.Name, "System")||(CONTAINS($Profile.Name, "Japan"))),TRUE, FALSE)}"   target="_blank" value="https://eu1.salesforce.com/apex/ReviewPDFcert_Japan?id={!Enrollment.id}">Japan certificate (except IRCA)</apex:outputlink><br/>
                       <apex:outputlink target="_blank" value="https://eu1.salesforce.com/apex/coverletter?id={!Enrollment.id}">coverletter</apex:outputlink></apex:column>
                       <apex:column headerValue="Cert Printed?"><apex:inputField value="{!Enrollment.Certificate_Printed__c}"/></apex:column>
                       <apex:column headerValue="Select PDF Certificates to Email"><apex:inputField value="{!Enrollment.Email_PDF_Certificate__c}"/></apex:column>
                   </apex:pageBlockTable>
              </apex:pageBlockSection>                        
        </apex:pageBlock>
    </apex:form>    
</apex:page>

 

 

Many Thanks for any help anyone can offer on this - I am new to development.

 

  • February 01, 2012
  • Like
  • 0
Hi, I am creating a pdf document using VF.In this pdf, i m placing the image in the first page.In addition to this, i have to make the image as watermark in the document.So i dont know how to give the watermark for the image using css...If anyone knows about this pls share.. Thanks, Priya