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
amar joshiamar joshi 

cant create task vf page

hi all

             i want to create task visualforece page but get the bellow error
    Could not resolve the entity from <apex:inputField> value binding '{!task.subject}'. inputField can only be used with SObject fields.

same things worked with account.

my code is as bellow  please help me out.

Code:
//VF page logic 
<apex:page controller="Task">
  <apex:form >
  <apex:pageBlock title="Task" mode="edit">
   <apex:pageBlockButtons >
  <apex:commandButton action="{!save}" value="save"/>
  </apex:pageBlockButtons>
  <apex:pageBlockSection title="Task Information">
  <apex:inputField value="{!account.name}"/>
  <apex:inputfield value="{!task.subject}"/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>

//task controller
public class task {

Task task;
Account account;


    public Task gettask() {
    if (task == null)
           task = new Task();
        return task;
        }
    
       public Account getaccount() {
    if (account == null)
           account = new Account();
        return account;
        }
      public PageReference save() {
      
        return null;
    }

}

 pleas help me its urgent in my project

dmsx2oddmsx2od
I posted a workaround to this using VF on my blog at http://www.x2od.com/2008/08/14/activities-tab-visualforce.html

I'm also working on a Task VF page.  I got it to work but the styling isn't perfect.  Fill in your contact details on my site and I'll let you know when the page is done.
dchasmandchasman
The root cause of your issue is that you have declared an apex class - your controller in this case - that is shadowing the Task SObject and you will need to use a different name for your Task class (e.g. TaskController). This is the document behavior of Apex Code and is not a Visualforce specific issue.
amar joshiamar joshi
thanks all
i got the solution.

thanks Doug Chasman.