You need to sign in to do that
Don't have an account?
Phuc Nguyen 18
Visualforce Page show parent record on Child creation
Hello All,
I have a VF page where I need to show the parent lookup field on the vf page.
This page is the creation page of the child record.
I have an extension but not able to grab the parent Id.
Extension is on the child object
Parent is AutoM__c
Child is Rental__c
Able to get fileds for child record but not parent.
Thanks,
P
I have a VF page where I need to show the parent lookup field on the vf page.
This page is the creation page of the child record.
I have an extension but not able to grab the parent Id.
Extension is on the child object
Parent is AutoM__c
Child is Rental__c
Able to get fileds for child record but not parent.
Thanks,
P
You can query parent fields like this: Let me know if you need any more information on this.
Thanks,
Abhishek Bansal.
All Answers
Try the Code Snippet as mentioned in the below discussion,
https://salesforce.stackexchange.com/questions/197267/how-to-create-the-child-record-from-parent-object-vf-page
For further reference, you can check this,
http://forceforte.com/how-to-insert-parent-record-and-list-of-child-records-in-visualforce/
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.
You need to query the Name field from the Parent object. By default only Id is available so if you want to reference any other fields than please make sure those fields are queried from the database.
Let me know if you need any further information on this.
Thanks,
Abhishek Bansal.
ex parentid = [SELECT Id, Name.... FROM AutoM__c WHERE id = :????;
How do I reference the field in the visualforce page?
Thanks
You can query parent fields like this: Let me know if you need any more information on this.
Thanks,
Abhishek Bansal.