Activity Forums Salesforce® Discussions Click on button redirect to another page in Salesforce.

  • Ajay Prakash

    Member
    January 4, 2018 at 7:03 am

    Hi Up,

    If you are calling controller method from lightning component then you can not return Pagereference from that controller method because AuraEnabled methods do not support return type of System.PageReference.

    Workaround-

    You can open any link from your callback of javascript controller

    action.setCallback(this,function(response){
    if((response.getState()=="SUCCESS")&&(component.isValid())){
    if(response.getReturnValue() != null){
    window.location.href = 'your link';
    } }
    });

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos