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
Kyle Johnson 46Kyle Johnson 46 

Unknown Property 'String.Name' - Field Shows up As ID

Hello,

I am trying to update a field on our sales invoices. I have added a contact field that is populated via the process builder. The issue I am having is that the contact is appearing as the contact ID on the sales invoice, it does show up as the name in the field. So I tried to add ".Name" at the end of the field on visual force page but I get the Unknown Property 'String.Name' 

Here is the fields API Name:
Finance_Contact__c

Here is the portion of the visualforce page:
 
<td class="alignTop">
                    <p>
                        <apex:outputText rendered="{!salesInvoice.c2g__Account__r.Name!=''}" escape="false">
                            {!salesInvoice.Agency_Name__c}<br/>
                        </apex:outputText>
                        ATTN:<br/>
                        <apex:outputText rendered="{!salesInvoice.Finance_Contact__c.Name}" escape="false">
                                {!salesInvoice.Finance_Contact__c.Name}
                                 </apex:outputtext>  
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_Street__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_Street__c}<br/>
                        </apex:outputtext>                                
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_City__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_City__c},
                        </apex:outputtext>
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_State__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_State__c}
                        </apex:outputtext>                                
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_Postal_Code__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_Postal_Code__c}   
                      </apex:outputtext>
                    </p>
                </td>
               
            </tr>
        </table>

 
Kyle Johnson 46Kyle Johnson 46
The line that I need help with is 7 and 8. Thanks!
Karan Shekhar KaulKaran Shekhar Kaul
Hi 

Try below code.

<td class="alignTop">
                    <p>
                        <apex:outputText rendered="{!salesInvoice.c2g__Account__r.Name!=''}" escape="false">
                            {!salesInvoice.Agency_Name__c}<br/>
                        </apex:outputText>
                        ATTN:<br/>
                        <u><b><apex:outputText rendered="{!salesInvoice.Finance_Contact__r.Name}" escape="false">
</b></u><b>                               </b><b> </b><u><b>{!salesInvoice.Finance_Contact__r.Name}</b></u>
                                 </apex:outputtext>  
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_Street__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_Street__c}<br/>
                        </apex:outputtext>                                
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_City__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_City__c},
                        </apex:outputtext>
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_State__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_State__c}
                        </apex:outputtext>                                
                        <apex:outputText rendered="{!salesInvoice.Agency_Billing_Postal_Code__c!=''}" escape="false">
                                {!salesInvoice.Agency_Billing_Postal_Code__c}   
                      </apex:outputtext>
                    </p>
                </td>
               
            </tr>
        </table>
Karan Shekhar KaulKaran Shekhar Kaul
Were you able to solve the issue?