function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tmbarrytmbarry 

How to reference a non standardcontroller field in a VisualForce page?

I am trying to create a form that creates a PDF of certatin Opportunity data.  However the first two pieces of data I need on the form are not opporunity data elements.  The first is the name of the actaul SF user creating the PDF i.e., the user's name (Field 1) and the second is today's date (Field 2).  How do I refernce these non opporunity data elements once I set my standardcontroller to "opportunity"?
 
<apex:page Standardcontroller="opportunity" id="{!opportunity.id}" >
  <apex:form >
 
  <table border="0" width="100%" id="table1" cellspacing="0">
    <tr>
        <td width="40%"><b>COMPLETED BY:</b> &nbsp; <apex:outputText value="{Field 1}"> </apex:outputText>  </td>
        <td width="60%"><b>DATE:</b> &nbsp;  <apex:outputText value="{Field 2}"> </td>
    </tr>
    <tr>
       <td width="100%"><b>Opportunity Name:</b> &nbsp; <apex:outputField value="{!opportunity.name}"> </apex:outputField> </td>

  </table>
 
Thanks,
 
Todd B
SuzanyuSuzanyu
try
 
value="{Field 1}"   --> value = "{!$User.FirstName}.{!$User.LastName}"
 
value="{Field 2}"   --> value = "{!DAY(Today())}/{!MONTH(Today())}/{!YEAR(Today())}"
 
 
tmbarrytmbarry

Thank you very much.  I really aprreciate the help. 

Why did you need the $ sign for the user object {!$User.FirstName} but I didn't need it for the opportunity object {!opportunity.id}?

Can I ask one more question?  How do I show the list of open activites on the same screen.  I know it has something to do with the relatedlist function, but I have no idea how to code it.

Thanks again,

Todd B.



Message Edited by tmbarry on 12-08-2008 08:04 PM