I open a second 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 doInit
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.
I'm trying to either close the first component out when I navigate to the second or refresh the first when I go back. How can I do that?
Here is the code on the second component to save record and navigate back to first component.
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();
},