Skip to main content
I created a visualforce page that use account (standard object) as a realated field, in to the custom object Customer_s_Price_List__c, so that I want to do is dynamically show the name of the company in to the section header instead to show the ID (18 digits)...

Can somebody help me???

Trying to display Account.Name dynamically instead Id

My visualforce code below...

<apex:page cache="true" expires="600" standardController="Customer_s_Price_List__c" extensions="Plasma_controller_SFDC1" showHeader="false" tabStyle="account">

<apex:sectionheader title="Customer Price -" subtitle="{!Customer_s_Price_List__c.Account__c}"/>

<chatter:feedwithfollowers entityId="{!Customer_s_Price_List__c.Id}"/>

<apex:form >

THANKS in advance...
13 respostas
  1. 1 de out. de 2015, 17:37
    Hi Javier

    At first you need create new property in your extension

    public String acctName {get; set}

    After that you need add code to constructor, or if constructor not created, create it. your constructor must have name Plasma_controller_SFDC1

     

    public Plasma_controller_SFDC1() {

    // your code here

    acctName = [SELECT Id, Name FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('accid')].Name;

    }

    and after this use {!acctName} insted of {!Customer_s_Price_List__c.Account__r.name}

    As a common practice, if your question is answered, please choose 1 best answer. 

    But you can give every answer a thumb up if that answer is helpful to you.

    Thanks,

    Alex

0/9000