I have a custom button on Opportunity for creation of a record with a predefined stage. I need to get back to the listview I started with if I cancel the operation
So I paste in the URL section:
/lightning/o/Opportunity/new?defaultFieldValues=StageName=Prospect
I do it from a list view. And if I cancel the operation I need to return to the listview I started with. So far I was able to redirect to a certain listview by entering its API name:
&count=1&nooverride=1
&navigationLocation=LIST_VIEW
&backgroundContext=%2Flightning%2Fo%2FOpportunity%2Flist%3FfilterName%3D__Recent
&useRecordTypeCheck=1
&recordTypeId={!Opportunity.RecordTypeId}
instead of __Recent I can paste the API name of any other listview and after canceling it will redirect me there. But how to redirect to the listview I started with? I tried to enter currentPageUrl but it does't work, rather redirects me to an unexisting listview. Maybe I need to place any other parametr other then filterName?