You need to sign in to do that
Don't have an account?
fiona gentry
How To Get Case Id in Lightning such that after save action Case is shown and not related list
Dear pals,
How do i Get Case Id in Lightning such that after save Case is shown and not related list,
currently after save Most recent cases are shown ,i need to show the associated Case after save and not List view,how to achieve this
current apex class for list view is
Lightning component cmp file is
any help to display the Case itself after save is highly appreciated
Regards,
Fiona
How do i Get Case Id in Lightning such that after save Case is shown and not related list,
currently after save Most recent cases are shown ,i need to show the associated Case after save and not List view,how to achieve this
current apex class for list view is
@AuraEnabled public static List<ListView> getListViews() { List<ListView> listviews = [SELECT Id, Name FROM ListView WHERE SobjectType = 'Case' and Name = 'Recently Viewed Cases']; return listviews;
Lightning component cmp file is
var action = component.get("c.getListViews"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { var listviews = response.getReturnValue(); var navEvent = $A.get("e.force:navigateToList"); navEvent.setParams({ "listViewId": listviews.Id, "listViewName": null, "scope": "Case" }); navEvent.fire(); } }); $A.enqueueAction(action);
any help to display the Case itself after save is highly appreciated
Regards,
Fiona
Use new lightning:navigation component for that. Just add it to your component: Also ensure your component implements force:hasRecordId and in method navigate to detail page, replace the code from:
To below format: If needed refer to example given on below link:
https://developer.salesforce.com/forums/?id=9062I000000IFsbQAG\
https://wedgecommerce.com/lightningnavigation-lightning-component/
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.