Hi Matt - sorry... validation rule will go on the Task... not the lead. Try this code:
<apex:page standardController="Task" extensions="TasksExtention" showHeader="true" tabStyle="Lead">
<style>
.activeTab {background-color: ⌗236FBD; color:white;
background-image:none}
.inactiveTab { background-color: lightgrey; color:black;
background-image:none}
</style>
<apex:form >
<apex:pageBlock title="Log a Task"> <apex:pageMessages ></apex:pageMessages>
<apex:pageBlockSection >
<apex:inputField value="{! Task.Ownership__c}" label="Take Ownership of This Lead" rendered="{!CheckOwnership}"/>
</apex:pageBlockSection>
<apex:pageBlockSection >
<apex:inputField value="{! Task.Type}" required="true"/>
<apex:inputField value="{! Task.ActivityDate}" required="true"/>
<apex:inputField value="{! Task.Rating__c}"/>
<apex:inputField value="{! Task.Description}" style="width:90%; height:250%" required="true"/>
<!--<apex:inputField value="{! Task.Why no Appt}"/>-->
</apex:pageBlockSection>
<apex:pageBlockSection columns="1" showHeader="false">
<apex:outputText label=" " style="font-weight:800" value="Update the Ad Series if the lead/contact is responding to advertising."></apex:outputText>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Ad Series" for="AdSeries"></apex:outputLabel>
<apex:selectList id="AdSeries" value="{!Task.Ad_Series__c}" size="1" title="Ad Series">
<apex:selectOptions value="{!AdSeries}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!saveTask}" value="Save"/>
<apex:commandButton action="{!saveTaskAndEmail}" value="Save & New Email"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
5 answers