Why I will get all the time this error?

Could not resolve the entity from value binding '{!order.test}'. <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.

OrderItem - Class:

public with sharing class OrderItem {

  public OrderItem(){

  public OrderItem(String contactId){
    this.contactId = contactID;

  public String test = 'test';

Contact - Extension Class

public with sharing class ExtendedContact {

public Contact contact {get; set;}

 public OrderItem order {
  get {
      if (order == null)
        order = new OrderItem();
      return order;


<apex:page standardController="Contact" extensions="ExtendedContact">
<apex:form >
  <apex:pageMessages />
  <apex:detail relatedList="true"/>
  <apex:pageblock title="ExtendedContact">
    <apex:pageBlockSection title="Title" columns="1">
    <apex:inputField value="{!order.test}" 
                    style="width:300px; height:100px" required="TRUE"/>

Thanks for any help.


I think there are two issues:

  • apex:inputField can only bind to an SObject field (as it takes the type and label from the field metadata) but you are trying to bind it to a String; use apex:inputText instead
  • you have not provided get/set methods for OrderItem.test; one way to accomplish this is to change the code to initialise in the constructor and then use a public String test {get; set;} Apex Property
| 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.