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
Muhammad WasimMuhammad Wasim 

Mileage Tracker App - Custom VisualForce page problem

Error Error: Unknown property 'Contact__c.Miles__c' referenced in MyMileagePage

 

<apex:page >
  <!-- Begin Default Content REMOVE THIS -->
  <h1>{!$User.FirstName}'s Mileage Perspective</h1>
  <apex:detail/>
  <apex:detail subject="{!Contact__c.Miles__c}" />   
     
</apex:page>
Best Answer chosen by Muhammad Wasim
Sonam_SFDCSonam_SFDC
Please add the standardController='Contact' with the apex:page tag

something like:

<apex:page standardController="contact" extensions="testemail">
<apex:form>
<apex:commandButton value="SendEmail" accesskey="{!sendemail}"/>
</apex:form>
</apex:page>

All Answers

Sonam_SFDCSonam_SFDC
Please add the standardController='Contact' with the apex:page tag

something like:

<apex:page standardController="contact" extensions="testemail">
<apex:form>
<apex:commandButton value="SendEmail" accesskey="{!sendemail}"/>
</apex:form>
</apex:page>
This was selected as the best answer
ShashForceShashForce
If contact__c is a custom object that you are using, then you shoudl include standardcontroller="contact__c" in the apex:page component
Grazitti TeamGrazitti Team
Hi  Muhammad Wasim,

you have not associated any Standard or custom controller to this Page to which the field "Contact__c.Miles__c " belongs.
include the Controller Like:
If standard controller:
<apex:page standardcontroller="Your_Controller_Name">

if custom controller:
<apex:page controller="Your_Controller_Name">.

please mark it best if it helps you.
Thanks & Regards ,
Grazitti Team

AMKAMK
Hi There, 

when we use Standerd controller we dont need to use __c in sufix. You can always check API name of standerd controller at below URL.. :)

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_list.htm

Enjoy..