• frankjr
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

Hi,

 

I've got an issue that I've yet to find a good solution.  It seems that others have solved it for their needs, but for me, it continues to plague me.  Here's the issue:

 

I have a VF page that prints out to PDF.  The VF Page is using a standard controller for the Opportunity table.  In my Opportunity table, I have a CUSTOM field (Customer_Contact__c) that's a lookup to a Contact record. Below is my VF code:

 

<apex:page standardController="Opportunity" recordSetVar="SelectedOpps" renderAs="pdf">
    <apex:variable var="number" value="{!0}"/>
    <apex:repeat value="{!selected}" var="SelectedOpp">
        <apex:variable var="number" value="{!number + 1}"/>
        <Scout9:StandardSheetLabel LabelNumber="{!number}" ProductName="5164" Brand="Avery" ShowBorder="false">
            <br></br><br></br><br></br><br></br><br></br><br></br><br></br>
            <table width="100%" height="100%" cellpadding="2">
                <tr>
                    <td><apex:outputText value="{!SelectedOpp.Customer_Contact__c}"/></td>
                </tr>
                <tr>
                    <td><apex:outputText value="{!SelectedOpp.Account.Name}"></apex:outputtext></td>
                </tr>
                <tr>
                    <td><apex:outputText escape="false" value="{!SelectedOpp.Customer_Mailing_Address__c}"></apex:outputtext></td>
                </tr>
            </table>
        </Scout9:StandardSheetLabel>
    </apex:repeat>
</apex:page>

 

The code above will display the contact's ID value, which is great and all, but I need the contact's name, not the ID.  Changing the above line to:

 

<td><apex:outputText value="{!SelectedOpp.Customer_Contact__c.Name}"/></td>

 

Only leads to the following error message:

 

"Error: Unknown property String.Name."

 

I've tried changing outputText to outputField, but that yields the name as a link, but I don't want a link. I just need to get the name value.  Does anyone know what's going on?  It would seem that the ".Name" notation only works for standard fields.

 

Help! ~ Thanks in Advance!

  • September 04, 2012
  • Like
  • 0

I have three objects that I'd ike to relate.  Accounts, Sales Documents, and Applications.  The last two are of course, custom objects.  I have one lookup field in each of the custom objects.  One lookup field relates Sales Documents to Applications, and another relates Applications to Accounts. 

 

I want Salesforce to be able to automatically relate the records together based on a unique value in the Sales Document record.  For example, if the discount key field in the Sales Document record matches that found in the Applications record, it'd create the relationship between Application and Sales Document, and create the relationship between Account and Application as well (since the Account is already found on the Sales Document record.)  I'd like to be able to do this automatically when the Sales Document record is saved in Salesforce.  Can anyone point me in the direction for accomplishing this?  Is it Apex code that I need to do?  Triggers? Or can I use workflows?

 

Thanks in advance.

-Frank

Hi,

 

I've got an issue that I've yet to find a good solution.  It seems that others have solved it for their needs, but for me, it continues to plague me.  Here's the issue:

 

I have a VF page that prints out to PDF.  The VF Page is using a standard controller for the Opportunity table.  In my Opportunity table, I have a CUSTOM field (Customer_Contact__c) that's a lookup to a Contact record. Below is my VF code:

 

<apex:page standardController="Opportunity" recordSetVar="SelectedOpps" renderAs="pdf">
    <apex:variable var="number" value="{!0}"/>
    <apex:repeat value="{!selected}" var="SelectedOpp">
        <apex:variable var="number" value="{!number + 1}"/>
        <Scout9:StandardSheetLabel LabelNumber="{!number}" ProductName="5164" Brand="Avery" ShowBorder="false">
            <br></br><br></br><br></br><br></br><br></br><br></br><br></br>
            <table width="100%" height="100%" cellpadding="2">
                <tr>
                    <td><apex:outputText value="{!SelectedOpp.Customer_Contact__c}"/></td>
                </tr>
                <tr>
                    <td><apex:outputText value="{!SelectedOpp.Account.Name}"></apex:outputtext></td>
                </tr>
                <tr>
                    <td><apex:outputText escape="false" value="{!SelectedOpp.Customer_Mailing_Address__c}"></apex:outputtext></td>
                </tr>
            </table>
        </Scout9:StandardSheetLabel>
    </apex:repeat>
</apex:page>

 

The code above will display the contact's ID value, which is great and all, but I need the contact's name, not the ID.  Changing the above line to:

 

<td><apex:outputText value="{!SelectedOpp.Customer_Contact__c.Name}"/></td>

 

Only leads to the following error message:

 

"Error: Unknown property String.Name."

 

I've tried changing outputText to outputField, but that yields the name as a link, but I don't want a link. I just need to get the name value.  Does anyone know what's going on?  It would seem that the ".Name" notation only works for standard fields.

 

Help! ~ Thanks in Advance!

  • September 04, 2012
  • Like
  • 0