You need to sign in to do that
Don't have an account?
Sarvesh Prajapati
Visual force query
Hi
I have created 2 objects as Job Application and Candidate, and defined a field candidate on Job Application as relationship. Now I want to display the data from both job application and candidate. Please tell me how I can achieve this. I have written below code, but its not working.
VF Page
<apex:page standardController="Job_Application__c" extensions="extension1">
{!AppCandDet}
</apex:page>
Extension
public class extension1 {
Candidate__c cand = new Candidate__c();
Job_Application__c jbap;
public extension1(ApexPages.StandardController controller)
{
jbap=(Job_Application__c)controller.getRecord();
}
public string getAppCandDet()
{
cand=[select First_Name__c, Last_Name__c from Candidate__c where Id =:jbap.id];
return 'Job Application:'+' Candidate - First Name'+cand.First_Name__c+' '+cand.Last_Name__c;
}
}
I have created 2 objects as Job Application and Candidate, and defined a field candidate on Job Application as relationship. Now I want to display the data from both job application and candidate. Please tell me how I can achieve this. I have written below code, but its not working.
VF Page
<apex:page standardController="Job_Application__c" extensions="extension1">
{!AppCandDet}
</apex:page>
Extension
public class extension1 {
Candidate__c cand = new Candidate__c();
Job_Application__c jbap;
public extension1(ApexPages.StandardController controller)
{
jbap=(Job_Application__c)controller.getRecord();
}
public string getAppCandDet()
{
cand=[select First_Name__c, Last_Name__c from Candidate__c where Id =:jbap.id];
return 'Job Application:'+' Candidate - First Name'+cand.First_Name__c+' '+cand.Last_Name__c;
}
}
You can try this.
Regards,
Mahesh
All Answers
Please find the below VF Page:
Controller:
I couldnt execute it my system, please verify and let me know if any issues.
Regards,
Mahesh
I'm getting below error.
Error: Unknown property 'Job_Application__cStandardController.jbap
Sarvesh
You can try this.
Regards,
Mahesh
Its working.
Thanks.