+ Start a Discussion

Navigate back to Original Lightning Component - Not showing New Records

I have a lightning component that calls a second lightning component to clone records.  After I am done on this second component, I want to navigate back to the original and refresh it so it includes the new records.  I am able to return back to the original lightning component but the newly created records are not displaying unless I click refresh on browser.  How can I navigate and refresh?  THis is how I am returning to my original component on save:
createClones: function(component, GroupStructures) {
    //Save the expense and update the view
    console.log('### Im in the first function ' );
    this.upsertGS(component, GroupStructures, function(a) {
        //var groupstructures = component.get("v.newGroupStructures");
        component.set("v.newGroupStructures", GroupStructures);
    upsertGS : function(component, groupstructures, callback) {
        //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");
            "url" : "lightning/n/Group_Structures_List?//Aid=" + recordId + "&Tid=123456789"    
		//call apex to save the newly created group structures
  		var action = component.get("c.saveGroupStructure");
          	gs: groupstructures
  if (callback) {
      action.setCallback(this, callback);
        ///navigate back to groupstructures page


Raj VakatiRaj Vakati
Can you do one think .. You need to call the  init handler on the component when you navigate back tothe component .. 

So you no need to refresh ... 

Can you share the markup ?
Are you asking for the init code for the original component? the one that we are navigating back to?  If so, here is it:
doInit : function(component, event, helper) {

     //get the url and split so you get the aid id that is being passed
      	var URLAid = window.location.search.split('//')[1];
     //pull only the actual Account ID
    	 var Aid = URLAid.substring(4,19);
	 //set the Aid attribute on the component so it can be passed to the apex class through the helper
  		 component.set("v.Aid", Aid);
        // Retrieve group structure values during component initialization
		//console.log('### here is the groupStructures recordid var  ' + JSON.stringify(component.get("v.recordId")));	 
       // console.log('### vary' +  JSON.stringify(component.get("v.Aid"),null,4))