function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kshannonkshannon 

Pre-Populate a Visualforce Form Field

Hey,

 

I have a inputField that is a lookup, it is: 

 

<apex:inputField value="{!op.Account}" /> op is opporunity.

 

I want to prepopulate that with the ID of the account, it has already been chosen at this point, but i know traditionally value="" is what you use to populate an input field, although it must be an object, in this case its account. How can I push the account value into that input field?

Best Answer chosen by Admin (Salesforce Developers) 
kshannonkshannon

Just realized you need to just do this in the controller for where you are calling the fields of the input.

All Answers

kshannonkshannon

Just realized you need to just do this in the controller for where you are calling the fields of the input.

This was selected as the best answer
gautamgautam

Hi

 

Can we please describe how you achieved it ?