1

As a Beginner to Sales force following error is coming while I am making a page of commercial. Kindly help me out.

This is following code of my commercial object in which there are 4 record type-buy, sell rent In and Rent out. having field dependencies Pick list .

Error: Could not resolve the entity from value binding '{!Property Type}'. can only be used with SObjects, or objects that are Visualforce field component resolvable.

<apex:page controller="Commercial"  >
 <apex:form >
 <apex:messages style="color:red"></apex:messages>
 <apex:pageblock title="Commercial">
 <apex:pageblockbuttons >
 <apex:commandButton value="save" action="{!save}"/>
 <apex:commandButton value="Save&New" action="{!Quicksave}"/>
 <apex:commandButton value="Cancel" action="{!Cancel}"/>
 </apex:pageblockbuttons>
 <apex:pageBlockSection title="You are Looking for" columns="1" collapsible="false">
  <apex:pageblockSectionItem > 
  <apex:outputLabel value="I want to -" for="rt" /> 
  <apex:panelGrid columns="2"> 
  <apex:outputText value="RecordType" rendered="false" />
   <apex:selectList id="rt" value="{!RecordType}" size="1" required="true">
   <apex:selectOption itemValue="Select" itemLabel="Select"/>
   <apex:selectOption itemValue="Buy" itemLabel="Buy"/>
   <apex:selectOption itemValue="Rent In" itemLabel="Rent In"/>
   <apex:selectOption itemValue="Rent Out" itemLabel="Rent Out"/>
   <apex:selectOption itemValue="Sell" itemLabel="Sell"/>
    <apex:selectOptions value="{!RecordType}"/> 
   </apex:selectList>  
  </apex:panelGrid>
  </apex:pageblockSectionItem>
   <apex:pageBlockSection title="Choose the Property" collapsible="false" >
   <apex:pageblocksectionItem >
   **<apex:inputField value="{!Property Type}"/>**
    <apex:inputField value="{!Status}"/>
   </apex:pageblocksectionItem>
   </apex:pageBlockSection>
   <apex:pageblockSection title="Choose the Property Sub Type" collapsible="false" >
   <apex:inputField value="{!Property Sub Type}"/> 
   <apex:inputField value="{!Construction Age}"/> 
   <apex:inputField value="{!Bathrooms}"/> 
   <apex:inputField value="{!Condition}"/> 
    </apex:pageblockSection>
   <apex:pageBlockSection title="Criteria  by Size and Price  " collapsible="false" >
   <apex:inputField value="{!Size Unit}"/>
   <apex:inputField value="{!Price Unit}"/>
   </apex:pageBlockSection>
   <apex:pageblockSection title="Choose the Minimum and Maximum Size" collapsible="false" >
     <apex:inputField value="{!Size Min}"/>
      <apex:inputField value="{!Size Max}"/>
   </apex:pageblockSection>
   <apex:pageblockSection title="Expected Budget" collapsible="false"  >
   <apex:inputField value="{!Budget (Min)}"/>
   <apex:inputField value="{!Budget Max}"/>
   </apex:pageblockSection>
   <apex:pageblockSection title="Amenities" collapsible="false"  >
   <apex:pageblocksectionitem >
   <apex:inputField value="{!Amenities}"/>
   </apex:pageblocksectionitem>
   </apex:pageblockSection>
   <apex:pageblockSection >
   <apex:inputField value="{!Brokerage Type}"/>
   <apex:inputField value="{!Brokerage Comission}"/>
   </apex:pageblockSection>
  </apex:pageblockSection>
 </apex:pageblock>
 </apex:form>
</apex:page>
  • is "Property Type" a field in Object Commercial? – A-d Sep 22 '14 at 7:49
  • no its a pick list . Brokerage commission is number field and rest all are pick list which are dependent to each other. like property type and property sub type have field dependencies and so on.. . – Anurag Pareek Sep 22 '14 at 7:57
  • 1
    The value attribute uses the API name of a field (not its label), and typically a custom controller would provide a reference to the SObject to the page. So value="{!c.Property_Type__c}" with c a reference to a Commercial__c object is what is normally in Visualforce. I suggest you read some introductory material such as An Introduction to Visualforce. – Keith C Sep 22 '14 at 8:01
  • @Keith C - Thank you so much for the valuable info.. – Anurag Pareek Sep 22 '14 at 8:17
  • Keith, can you post that as an answer? I'd say you're right on the money, the spaces do give the game away! – Matt Lacey Sep 22 '14 at 8:30
2

The value attribute uses the API name of a field (not its label), and typically a custom controller would provide a reference to the SObject to the page. So:

value="{!c.Property_Type__c}"

with c a reference to a Commercial__c object is what is normally in Visualforce.

I also suggest you read some introductory material on Visualforce such as An Introduction to Visualforce before going much further.

  • now its saying -Error: Unknown property 'String.RecordType' – Anurag Pareek Sep 22 '14 at 9:22
  • 1
    @sfdcDeveloper I suggest you Google and otherwise research yourself on this problem for a while. That is a good way to learn. There are also resources like the Visualforce Workbook which will give you a good grounding on how to do things in Visualforce. If you are still stuck after that, post a new question with both the page and controller as one question/one answer is the format of this site. (I don't know the cause of this problem.) – Keith C Sep 22 '14 at 9:33

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.