+ Start a Discussion
acrozieracrozier 

Make the text of a field display instead of the ID

<apex:outputtext style="font-size:15px" value="for {!Quote.Opportunity.End_Client__c}"/>

 

This code pulls the End_Client ID instead of the name, how can I change that?

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Try this :

 

<apex:outputtext style="font-size:15px" value="for {!Quote.Opportunity.End_Client__r.Name}"/>

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

Try this :

 

<apex:outputtext style="font-size:15px" value="for {!Quote.Opportunity.End_Client__r.Name}"/>

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
Shashikant SharmaShashikant Sharma

As this End_Client__c is a reference field it will always come as ID, to show the name you can use a  Map like this

 

In controller :

 

public MAP<ID , String> mapEndClient = new MAP<ID , String>();

 

//Fill map like this

mapEndClient .put(Quote.Opportunity.End_Client__c , Quote.Opportunity.End_Client__r.Name);

 

//In VFP

<apex:outputtext style="font-size:15px" value="{!mapEndClient [Quote.Opportunity.End_Client__c]}"/>

 

let me know if any issue in it.

 

acrozieracrozier

its actually a lookup.  realized I just need to use End_Client__r.name

Ankit AroraAnkit Arora

Indeed!! Suggested you the same :)

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

Satish InugantiSatish Inuganti
Hi ,

In my webservice programm im getting ID of the master-detail record instead of record value.Below is my sample WS Programm and tested in workbench. Please, give me suggestions.

JFYI.... I have tested in WorkBench.

@restresource(urlMapping='/showJobpostingsRecords/*')
global class getJobposts
{
 @HttpGet
 global static List<Job_Posting__c> selectRecords()
 {   
   List<Job_Posting__c> jp=[select Position_Name__c,Employment_Website__c,Name from Job_Posting__c where Name = 'JP-0002'];
   return(jp);
 }
}