Lightning - skuid page edit but Parent doesn't update

  • 2
  • Question
  • Updated 1 year ago
  • Answered
We are migrating our org from a fully Skuidified Salesforce to Lightning + Skuid.  I've run into an problem, and hoping there is a fix.

We have a Lightning Detail page, let's say it is the Account page.  I have a related list of Contacts, using the SF out of the box related list.  I have decided to override the "Edit" button on the Contact object with a skuid page so I can conditionally show or control fields or other logic when my users edit.  My steps:

1) Create a Skuid Page "EditContact_LEX" that has a contact model taking the id from the URL parameter.  My "Save" button saves my contact model.  After save, I redirect the user back to to the Account detail page (Action framework: navigate to url: /{{Account.Id}}

2) Build a lightning component to call the Skuid Page, markup like this:
<aura:component implements="lightning:actionOverride,force:hasRecordId" access="global">
<skuid:page page="EditContact_LEX" id="{!v.recordId}"/>

3) On my Contact object setup > Buttons Links and Actions > I've overridden the Lightning and Mobile native "Edit" action to show my lightning component, which calls my Skuid page.

Testing this, when I click Edit from my Contacts related list, I go to my Skuid contact edit page and the context correctly pulls in.  I Save, and I get redirected to the Account detail page (lightning page.)  BUT....  my changes don't show in my contact related list.  If I re-load my browser / Account page, then my changes show up.

So, it is like the Account detail page was cached or something, and didn't update after I saved my contact edit from the skuid page, even though I was redirected there.  My Lightning contact related list is out of the box, so no custom component I can "refresh" somehow.  Or can I??  Can I somehow in my Contact Edit Skuid page tell my account page I want a REAL reload?
Photo of Chandra V

Chandra V, Champion

  • 7,720 Points 5k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 56,134 Points 50k badge 2x thumb
Official Response
Hey all, wanted to give an update on this:

1) It is possible, as of the current Millau release, for Skuid to force native Lightning Components, such as an Account detail view or an Account's Contacts related list, to update their data, by publishing the "force:refreshView" event. This is the recommended approach --- this is a much better user experience than the "navigateToSObject" approach. Just add a Model Action, with initiating events being "When Model saved", with a single action: "Publish Event", with the Event being "force:refreshView", and the scope being "All Skuid Pages and all Lightning Components"

2) To make this easier, in the Millau Update 2 release (early / mid May 2018), we will be adding most of the standard Lightning Experience / Salesforce1 Events to the combobox dropdown of Event Names available for publishing within Skuid's "Publish Event" action, to make it as easy as possible to do this without having to go consult the Lightning Events reference for the exact names of these events.

Again, publishing the force:refreshView action is the recommended way to get standard Lightning Components to update themselves in response to data changes initiated from Skuid. Doing a forced navigation is NOT recommended, this is slower and a poor user experience. Using force:refreshView allows for a seamless update of data without the user having to change page at all.