0

So I have an object that is a detail to an account. However, on the visualforce page I'd like to select a field off of the account to associate the account instead of the account name

Example: Account: Name, Acronym. Relationship between the custom object and the account is on the account name.

Entry Page: I want to display the acronym instead of the account name after selecting from the lookup.

I have my own custom controller if that helps.

As a frame of reference in C# forms you'd have a dropdown with 2 columns and the first column would be the relationship and the second would be the display field and you'd hide the first column. Similar concept here.

2

There's no way to assign a specific value to display in the standard apex:inputField element, and attempting to subvert this might have unintended consequences. You'd have to build your own custom lookup field, such as Jeff Douglas' code. Once you do that, you can control the entire process. Of course, you'll have to bind to various hidden fields, and alter the way the popup works to use other fields, but the principle is the same.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.