You need to sign in to do that
Don't have an account?
Chirag Sapkota 5
How to auto populate field values on lead record from Users or Contact records while creating a new lead via VF page form?
Hello developer gurus,
I have create a VF page form to capture leads for our community users. The form is StandradController "Lead" and TabStyle "Lead". I would like this form to be more advance. Below is the fuctionality I would like to create. I am newbee to the Apex.
1) Whenever a user (specially, Community User) access this form, the form should auto populate the User's FirstName, LastName, Email, Comapny, Account (info will be in Contact or User detail record)
Thank you in advance. Again, I would appreciate if you could provide me some codes
I have create a VF page form to capture leads for our community users. The form is StandradController "Lead" and TabStyle "Lead". I would like this form to be more advance. Below is the fuctionality I would like to create. I am newbee to the Apex.
1) Whenever a user (specially, Community User) access this form, the form should auto populate the User's FirstName, LastName, Email, Comapny, Account (info will be in Contact or User detail record)
Thank you in advance. Again, I would appreciate if you could provide me some codes
for your problem You have to create an extension(leadExtension) where you have to set the values you want to pre-populate. please see below code snippet. and let me know if you were looking for something like this. if yes hit like. Thanks!
"Error: Could not resolve the entity from <apex:inputField> value binding '{!CompanyName}'. <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable."
Please advise.
Thank you
You can set the values in extension's constructor if the field exist and use it as apex:inputfield in visualforce page. see the below updated code as per your requirment.
and let me know if it worked for you.
Thank you for the amend code. However, the atupopulation only work as for the record owner.
I using the form in our community portal via iframe. And, when community user access this form Their Name, Email and Account should autopopulate. This is not the case with the above code. Right now, it only auto populate the info of the form Creator eventhough I login as a community user and access the form. Please advise