You need to sign in to do that
Don't have an account?
suji srinivasan
how to fetch data for a lookupfield in visualforce page?
When i try to fetch data for a lookupfield .i got only id .can anyone suggest me what needs to be done to fetch values for the lookup fields.
Thanks in advance
Thanks in advance
Just try below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
What I guess is you can only get the id from the visualforce page if we have lookup for it. If you need the value for that then you have to write some logic for the same as you want the value for it.
It would be more clear if you share the code.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Please follow simple example
http://himanshurana.in/auto-populate-visualforce-page-field-lookup-fields/
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Employee Id is my lookup field which i am fetching from another app
VF page:
<apex:page standardController="Salary_Detail__c" extensions="salarydetails" renderAs="pdf" >
<table>
<apex:form > <apex:repeat value="{!Salary_Detail__c}" var="a" > <tr>
<td >Emp Code</td>
<apex:inputText value="{!Salary_Detail__c.Employee_ID__c}"> </apex:inputText> </td> </tr>
</apex:repeat></apex:form ></table>
Apex class:
public class salarydetails {
public Salary_Detail__c SalaryDetail{get;set;}
private ApexPages.StandardController controller;
public SalaryDetails(ApexPages.StandardController controller){
//SalaryDetail = Salary_Detail__c();
}
Public PageReference saveRecord() {
insert SalaryDetail;
PageReference pr = new PageReference('/'+SalaryDetail.id);
pr.setRedirect(true);
return pr;
}
}
thanks in advance.
Please use below code:-
VF:
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
As you suggested i changed it showing like invalid object
Just try below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh