You need to sign in to do that
Don't have an account?
sameer123
Master detail relationship lookup in VF page
Hi all,
I have custom VF page and a custom controller for it. I have one custom object which has custom field Account__c.
Account__c has master detail relationship with standard object "Account" . Using input field tag i want to show it on
VF page as a lookup field for accounts.
I am using
<apex:inputField id="account" value="{!acfContract.Account__c}"/>
I am not getting any error.
But on VF page only label account is displayed and not lookup tab.
Please help me.
Sameer master lookup behavior is you can add new record but you cannot edit that record after add. That is the reason for hide the lookup icon.
See following description for master lookup field
Creates a special type of parent-child relationship between this object (the child, or "detail") and another object (the parent, or "master") where:
The relationship field allows users to click on a lookup icon to select a value from a popup list. The master object is the source of the values in the list.
-Suresh
All Answers
Hello Sameer;
Once the value of the relationship field has been saved, it cannot be changed.(see Master-Detail Relationship Description)
-Suresh
Hi,
Thanks for reply.
What i want to do is, in my custom object contract i want to associate existing account with it.
So on my custom VF page form, where i accept values for custom object fields, i just want user to lookup accounts and select it for that particular contract object.
What should i do to get lookup icon for this feature???
Please help me.
Thank you.
I think better to create Lookup Relationship not master detail relationship.
-Suresh
Hi,
Yes i created lookup relationship and in that case its working fine.
But project manager said we need the relationship to be masterdetail.
So i am trying it.
When i try to create new record for my custom object using salesforces standard window to add new records then on
that page how it shows lookup icon? (even when my relation ship is master detail)
Also tell me what is meaning of your first reply.i didnt get it.
Thank you
Sameer master lookup behavior is you can add new record but you cannot edit that record after add. That is the reason for hide the lookup icon.
See following description for master lookup field
Creates a special type of parent-child relationship between this object (the child, or "detail") and another object (the parent, or "master") where:
The relationship field allows users to click on a lookup icon to select a value from a popup list. The master object is the source of the values in the list.
-Suresh
Hi,
Thank you very much for the help. :)