You need to sign in to do that
Don't have an account?
Doondi
how to equal it to ID ( Unit__c has Look up to property__c)
Query to get related records ?
Hi,
I am trying to build a vf page to display related list of records of a custom object
Here is my class and page:
public class DeleteFlag { public List<Unit__c> Records {get; set;} public DeleteFlag(ApexPages.StandardController controller) { Records =[Select Name, from Unit__c WHERE Name='a013B000003i1vZ']; } <apex:page standardcontroller="Property__c" extensions="DeleteFlag"> <apex:pageBlock mode="details" > <apex:form > <apex:pageBlockTable value="{!Records}" var="index" > <apex:column value="{!index.Name}"/> <apex:column value="{!index.Property_Unit__c}"/> </apex:pageBlockTable> </apex:form> </apex:pageBlock> </apex:page>In the above code, I am hard coding parent values,
how to equal it to ID ( Unit__c has Look up to property__c)
Select Name from Unit__c WHERE property__c='a013B000003i1vZ'
I am assuming that lookup API name at Unit__c object is property__c.
Please let me know if it helps.
Regards,
Pawan Kumar
@Pawan Kumar: I don't want to hard code the value of ID,
Select Name from Unit__c WHERE property__c=:ApexPages.currentPage().getParameters().get('id')
and when are you calling you VF pass in the URL at end ?id=a013B000003i1vZ
Regards,
Pawan Kumar