I created a action button for the Business License Application and its able to delete the record but I want to redirect to a list view. How do I accomplish this? I read I could use the url hacks but the problem with that approach is that it doesn't take the recordId for input from the record itself from testing so the record doesn't delete unless I take as an action button in the lightning record page.
Anything I do with LWC?
I found an approach figured I'd share in case anyone needs to run into this:
I created an LWC:
JS:
import { NavigationMixin } from "lightning/navigation";
import { LightningElement } from "lwc";
import { FlowNavigationFinishEvent } from 'lightning/flowSupport';
export default class RecentlyViewedBLAListView extends NavigationMixin(LightningElement) {
connectedCallback() {
this[NavigationMixin.Navigate]({
type:'standard__objectPage',
attributes: {
objectApiName: 'BusinessLicenseApplication',
actionName: 'list'
},
state: {
filterName: '__Recent'
}
});
}
}
meta-xml:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>66.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightningCommunity__Page</target>
<target>lightning__FlowScreen</target>
<target>lightning__HomePage</target>
<target>lightning__Tab</target>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
</targets>
</LightningComponentBundle>
Leave everything else as standard.
I used a screen flow where I created a variable called recordId avaialble for input added delete element. Then after the delete element used the LWC I deployed to my flow. It redirects to your recently-viewed list view for Business License Application after deletion.