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

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.
my code is as bellow please help me out.
thanks
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.
my code is as bellow please help me out.
thanks
Code:
//apex page code <apex:page controller="myTask"> <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 id = "subject" value = "{!task.subject}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> //controller code public class myTask { public PageReference save() { return null; } Task task; public Task getTask() { task = new Task(); return task; } }
then save the visualforce page, that worked for me
Somehow in the development mode, the quick fix did not recognize that mytask was returning a task, since it builds this as a string in quick fix mode.
it worked for creating an account and opportunity but not worked for task.
its worked for account but not for task
my code as bellow
Message Edited by amar joshi on 08-19-2008 12:14 PM
Try renaming your class to something else like MyTask.
the class Task that you defined was returned when you made the call
task = new Task();
rather than creating an sobject with all it's fields, you created an instance of the class (called Task) of your own definition.
its working
i have givan class name and instance of class name same thats why it confused and give the error
thanks all for helping me.