You need to sign in to do that
Don't have an account?

Create Lookup field to Contact on Custom Controller
How can I display a look up field to add a contact to a variable in Apex.
Visualforce
Apex
Thanks in advance.
Visualforce
<apex:form > <apex:dataTable id="contacts" value="{!ct}" var="conz"> <apex:inputField value="{!conz.id}" /> </apex:dataTable>
Apex
public virtual class StoreFront2 { public Contact ct{get;set;} public void handleContact(){ if(ct == null){ ct = new Contact(); ct.id = null;} } }
Thanks in advance.
Eg:
Visual Force Page:
Contrller Class:
Do let me know if this Help!
No such column 'Contact1__c' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. Line 13
I just want to be able for a user to select a Contact and pass it to a variable or wrapper class.
Apex
Visualforce
public Contact ct{get;set;}
Public StoreFront2(){
ct=[select Contact1__c from Contact limit 1];
}
if this also not working than use only that part of code which is give above because that code is workin for me
Errors
StoreFront2 Line 12 No such column 'Contact1__c' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
ConfirmBuy Line 1 Unknown property 'StoreFront2.ct'
Apex:
Visualforce