0

Requirement: On Case Object Custom List View(Queue), we have Accept button. When I Click on Accept Button, it transfer Record Ownership to Current User and it stays on the same list view similarly I want to create Custom List Button Similar to Accept Button and When I click on Custom Accept Button, record shoulde transfer to current user along with some pre-populated values in field which I am doing it in Process Flows(I can not use existing Standard Accept Button due to some other requirement).

Based on below link :

https://forcepanda.wordpress.com/2019/03/29/how-to-pass-record-ids-from-list-view-to-a-flow-in-lightning/

I have created Custom Button on List View of Case Object which calls VF page then Lightning Autolaunch Flows and update owner of multiple records which I selected in List View. I am trying to set finishLocation under flow:interview but when I do that, It Opens Page within Another page :

Here is the sample code:

VF Page:

<apex:page standardController="Case" recordSetVar="Cse" extensions="PassSelectedIdsToFlowVFController" lightningStylesheets="true">
    
    <flow:interview name="Mass_Action_List_View_Flow" finishLocation="{!pageA}">
        <!-- CaseIDsis flow input variable & SelectedCaseIDs is a property in the Apex controller -->
        <apex:param name="CaseIDs" value="{!SelectedCaseIDs}" />
    </flow:interview>
    
</apex:page>

Controller:

public class PassSelectedIdsToFlowVFController {
    
    public string[] SelectedAccountIDs{get;set;}
    
    public PassSelectedIdsToFlowVFController(ApexPages.StandardSetController listcontroller){
        SelectedAccountIDs = new string[]{};
        for(Case acc : (Case[])listcontroller.getSelected()){
            SelectedAccountIDs.add(acc.Id);
        }
    }
    
    public PageReference getPageA() {
        return new PageReference('/001'); // I want to set Custom List View URL here but even If I Set Recent List View, it opens page in another page(Display page within page).
    }
}

Goal: When AutoLaunched Process Flow is finised, I want to Navigate Back to the current list view where I was

Can someone please help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.