You need to sign in to do that
Don't have an account?
fiona gentry
How To Redirect The Lightning Component To Case List View After Save
Hi Pals,
I have Salesforce lightning component which edits a Multi level picklist and then after clicking Save ,This modal is shown up again
,Now instead of the same above modal after i click Save ,i would like to redirect to Case List View,
I wrote the below code in JS for save Button, but still i see the same Modal screen and not the redirect
Any help on this is highly appreicated
Regards,
Fiona
I have Salesforce lightning component which edits a Multi level picklist and then after clicking Save ,This modal is shown up again
,Now instead of the same above modal after i click Save ,i would like to redirect to Case List View,
I wrote the below code in JS for save Button, but still i see the same Modal screen and not the redirect
onConfirm:function(component, event, helper){ var picklist=component.find('ddLevel1'); var picklistvalue=picklist.get('v.value'); var picklistdep=component.find('ddLevel2'); var picklistvaluedep2=picklistdep.get('v.value'); var picklistoldL1=component.get('v.oldL1'); var picklistoldL2=component.get('v.oldL2'); var picklistoldL3=component.get('v.oldL3'); var ertrecordGuid=component.get('v.ertGUID'); var picklistdep3=component.find('ddLevel3'); var picklistvaluedep3=picklistdep3.get('v.value'); var action = component.get("c.savecasetype"); action.setParams({ 'level1' : picklistvalue, 'level2' : component.get('v.secondlevelselected'), 'level3' : picklistvaluedep3, 'oldlevel1' : picklistoldL1, 'oldlevel2' : picklistoldL2, 'oldlevel3' : picklistoldL3, 'guid':ertrecordGuid, 'id' : component.get("v.recordId")}); var toastEvent = $A.get("e.force:showToast"); action.setCallback(this, function(e) { if(e.getState()=='SUCCESS'){ var result=e.getReturnValue(); if(result==='successfull'){ toastEvent.setParams({ "title": "Success!", "message": "The record has been Upserted successfully." }); var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": "lightning/o/Case/list?filterName=Recent" }); urlEvent.fire(); toastEvent.fire(); }else{ toastEvent.setParams({ "title": "Error", "message": "The record has not been Upserted successfully." }); toastEvent.fire(); } } $A.get('e.force:refreshView').fire(); }); $A.enqueueAction(action); }
Any help on this is highly appreicated
Regards,
Fiona
I see that you are using force:navigateToURL in your code. Instead, can you try force:navigateToList redirect to the Listview by specifying listviewId
Sample code snippet This Apex controller returns list view named "Recently Viewed" for the Case object. Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you