Posts

Showing posts with the label refresh

Salesforce Fact #914 | Rerender in Aura to refresh screen flow

Suppose we have created an aura component which embeds a screen flow and it is used as the New button override for the Contact object. Now, while creating record from the Contact related list in the Account detail page we are passing the current account id by parsing the URL. Now, if we leave the screen flow midway and open another account record without refreshing the page and click on the new button on contact related list, it lands on the same page where we had left and the accountId passed is also the old one. To resolve this, we can add the below piece of code in the renderer JS: ({      // Your renderer method overrides go here rerender : function(cmp, helper){     this.superRerender();     // do custom rerendering here      $A.get('e.force:refreshView').fire(); } }) With this code added, every time the flow is invoked it gets the correct accountId and starts from first screen.

Salesforce Fact #831 | Refresh utility bar lightning component on tab change

Image
While using any lightning component in the utility bar, it does not get refreshed whenever we change the tabs. However, we can make use of aura:locationChange to detect any change in the url and add logic accordingly. Reference:  https://developer.salesforce.com/docs/component-library/bundle/aura:locationChange/documentation In this simple example, we are just printing the current time every time the tab is changed to show that it is a different value each time. Attached are the screenshots.