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
kgrasukgrasu 

Why can't I add the Assiged To field in Task to my visualforce page?

Hi
I am trying to override the edit page for "Log a Call" or task with a custom visualforce page. I am having trouble getting some of the fields like
Assigned To,
Related To and
the checkbox "Send Notification Email".
I was able to add other fields uisng the API names.
 
Appreciate if anyone can help with the right way to adding the above fields in VF page.

When I add the following for the Assigned To, it throws the error "Assigned To ID: owner cannot be blank". Basiaclly I want to display the Assigned To field as it appears in the standard Log a Call edit page. Is there some reference available somewhere for converting all these fields in the standard page into a VF page?
 
VF Code:
<apex:page standardController="Task" extensions="conTaskNew">
<apex:form >
       <apex:pageBlock id="mypageblock" title="Task Edit" mode="new">       
     
            <apex:pageBlockButtons >                    
            <apex:commandButton onclick="return lsave()"   action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Task Information" columns="2" id="theSection">  
           <apex:inputField id="vOwner" value="{!task.OwnerId}"/>             
            <apex:inputField id="vActDate" value="{!task.ActivityDate}"/>     
            <apex:inputField id="vsubject" value="{!task.Subject}"/>                
     </apex:pageBlockSection>               
</apex:pageBlock>
</apex:form>
</apex:page>

 Appreciate all your valuable feedbacks.
sfdcdev.wordpress.comsfdcdev.wordpress.com
You can add Related to Field using :

 <apex:inputField id="realtedToId" value="{!task.WhatId}"/>

And assigned to Id by using:
           
<apex:inputField id="taskAssignedToId" value="{!task.OwnerId}"/>

However, I have no idea how we could get Send Email Notification.

It would be great if anyone can help us with that.
kgrasukgrasu
Hi Girish,

Thanks for your response. I had already tried with <apex:inputField id="taskAssignedToId" value="{!task.OwnerId}"/>. But I got the following error.
“Assigned To ID: owner cannot be blank”.
Am I missing something here?

Thanks and regards
Rasu
VarunCVarunC
Anyone who was able to get the "Send Email Notification" checkbox in the VF page ?