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

i cant nevigate my page its say u must have to enter a data even i click cancle result is same
hi all
in my page its combination of lead and task object
i have some lead fields and some task fields
some task's fields are required
when i click to cancel button to cancel that operation it cant navigate it says u must have to enter data
please advise if i m doing wrong..
controller
well it can done if i put like
thanks & regards
Amar Joshi
Message Edited by amar joshi on 09-26-2008 04:55 PM
in my page its combination of lead and task object
i have some lead fields and some task fields
some task's fields are required
when i click to cancel button to cancel that operation it cant navigate it says u must have to enter data
please advise if i m doing wrong..
Code:
page code
<apex:page controller="convertdemo11" tabstyle="lead">
<apex:sectionHeader title="Convert Lead"subtitle="{!lead.owner.name}"/>
Leads can be converted to accounts, contacts, opportunities, and followup tasks.
<br>You should only convert a lead once you have identified it as qualified.</br>
<br>After this lead has been converted, it can no longer be viewed or edited as a lead, but can be viewed in lead reports.</br>
<br> </br>
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageblockButtons >
<apex:commandButton action="{!convertLead}" value="convert"/>
<apex:commandButton action="{!cancle}" value="cancle"/>
</apex:pageblockButtons>
<apex:pageBlockSection title="Convert Lead">
<apex:inputfield value="{!lead.Record_Owner__c}"/>
<apex:pageblockSectionItem ></apex:pageblockSectionItem>
<apex:pageBlockSectionItem >
</apex:pageblocksection>
<apex:pageblocksection title="Task Information">
<apex:inputfield value="{!task.subject}"/>
<apex:inputfield value="{!task.Branch_Name__c}" required="True"/>
<apex:inputfield value="{!task.ActivityDate}"/>
<br><apex:inputfield value="{!task.Description}"/></br>
</apex:pageblocksection>
<apex:pageBlockSection title="Other Information">
<apex:inputfield value="{!task.Priority}"/>
<br><apex:inputfield value="{!task.Status}"/></br>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Code:
///////////controller///////////// public class convertdemo11 { Task task; public Task gettask() { if (task == null) task = new Task(); return task; } public PageReference cancle() { String m2 = '/'+ApexPages.currentPage().getParameters().get('id'); PageReference pageref = new Pagereference(m2); return pageref; } public PageReference convertLead() { return null; } public Lead getLead() { Lead a; a= [select owner.id,owner.type,owner.name,Record_Owner__c,company,Group_Company__c from Lead where id = :ApexPages.currentPage().getParameters().get('id')]; a.Record_Owner__c=a.owner.id; return a; } }
well it can done if i put like
<apex:inputfield value="{!task.Branch_Name__c}" required="false"/>
but i want to add functionality that when we click convert button we must have to enter tasks required field
but when click cancel button it can navigate to pagereference page without showing error.
thanks & regards
Amar Joshi
Message Edited by amar joshi on 09-26-2008 04:55 PM

Use immediate="true" in your cancel button, this will skip all validation checks when this button is clicked.
Code: