function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Can we access fields from the custom objects which are not directly related to each other in a visual force page ?How?
Yes through SOQL query in Apex controller. But did not understand the use case for this !!
Yes you have to declare the Sobject variable in your apex controller like in the example below
public class mycontroller{
public Opportunity v_opp {get; set;}
public mycontroller() {
v_opp = new Opportunity();
Id id = ApexPages.currentPage().getParameters().get('id');
v_opp = [select Id, Name ....... from Opportunity where Id =: id];
}
}
Then make reference to the field from the Visualforce page For example
<apex:PageBlocksectionitem>
<apex:outputLabelvalue="Loan Term(In Months)"/>
<apex:panelgridcolumns="1">
<apex:outputTextvalue="{!v_opp.Loan_Term__c}" rendered=""true" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
thanks for the code too
Yes through SOQL query in Apex controller. But did not understand the use case for this !!
All Answers
Yes through SOQL query in Apex controller. But did not understand the use case for this !!
Yes you have to declare the Sobject variable in your apex controller like in the example below
public class mycontroller{
public Opportunity v_opp {get; set;}
public mycontroller() {
v_opp = new Opportunity();
Id id = ApexPages.currentPage().getParameters().get('id');
v_opp = [select Id, Name ....... from Opportunity where Id =: id];
}
}
Then make reference to the field from the Visualforce page For example
<apex:PageBlocksectionitem>
<apex:outputLabelvalue="Loan Term(In Months)"/>
<apex:panelgridcolumns="1">
<apex:outputTextvalue="{!v_opp.Loan_Term__c}" rendered=""true" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
thanks for the code too