+ Start a Discussion
harish r 20harish r 20 

convert button code

Hi 


vf page 

public class leadController {
        
public leadController(ApexPages.StandardController controller) {
}
public Task getTask(){
    Task tsk = new Task();
    return tsk;
}
    
}

apex class 


public class leadController {
        
public leadController(ApexPages.StandardController controller) {
}
public Task getTask(){
    Task tsk = new Task();
    return tsk;
}
    
}



In this code press convert button it will refresh to get same page. what i have to in this situation? 

please reply me as soon as possible


Regards
Harish.R
harishramachandruni04@gmail.com
 
 
James LoghryJames Loghry

Hi, you posted your Apex class in the "VF page" area, fyi.  Also, please post any VF markup or apex code using the code format button (< >).

As for your issue, sounds like you need to create a apex method for handling the convert logic.  That method shall return a null PageReference.  When you call that method from your VF page, the you'll use the rerender tag to rerender a certain area, such as a form. 

There's several references if you google for them including here on the dev boards, salesforce.stackexchange.com, blogs on developer.salesforce.com, and also challenges around this particular topic on developer.salesforce.com/trailhead.