You need to sign in to do that
Don't have an account?
Fred13
Refresh when navigating back to component
I have been working on this for quite a while without success. I posted this previously but did not get an answer. I open a secnd component to add some records and when I save, I navigate back to the original component. THe problem is that the newly created records do not display on the original component. The odd thing is that the doint function does not fire when I navigate back. Therefore, my assumption is that the first component never closes when I navigate to the second component to create the records. Please help!!!!! Trying to either close the first component out when I navigate to the second or refresh the first when I go back. Here is the code on the second componet to save record and navigate back to first component. thanks!!!!
Fred
Fred
insertGS : function(component, groupstructures, callback) { //call apex to save the newly created group structures var action = component.get("c.saveGroupStructure"); action.setParams({gs: groupstructures }); $A.enqueueAction(action); ///This part of code is used to navigate back to the GroupStructuresList Component //variable to hold the account id for my naviagation back to original component var recordId = component.get("v.existinggroupstructure.Account__c") //set urlEvent Variable to navigate back to the original component var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url" : "lightning/n/Group_Structures_List?//Aid=" + recordId + "&Tid=123456789" }); ///navigate back to groupstructures page urlEvent.fire(); },
This is the limitation of salesforce lightning, If we "e.force:navigateToURL" event then the navigate component will not call the doInit again or it will not refresh.
Here you add a workaround to call the doInit again.
Use window.location = '/lightning/n/Group_Structures_List?/Aid=" + recordId + "&Tid=123456789"'; instead of event.
Hope this will help you.
Please mark as solved and also best answer if it will solve your problem.
Thanks
Deepak.
https://horizonblue--lightning.lightning.force.com/lightning/n/Group_Structures_List?//Aid=001q000000nv4YTAAY&Tid=123456789
However, with your changes, I am navigating to this:
https://horizonblue--lightning.my.salesforce.com/one/lightning/n/Group_Structures_List?//Aid=001q000000nv4YTAAY&Tid=123456789
Is there a way to make an adjustment? thanks again!!!
Fred