Lightning - skuid page edit but Parent doesn't update

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}”/>
    </aura:component>

  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?

Anyone using Skuid + lightning figure out a way to get the page to refresh?

I know that skuid actions allow you to Publish Event to “Lightning : Show Toast Message”. Is there any support for e.force:refreshView that you can do from a custom lightning component code?

Hi Chandra,

Thank you for the detailed explanation! We found something that might help, maybe you can use this to investigate further. You can force a reload if the URL contains any new information. Therefore you can add an auxiliary parameter to the URL and make sure that its value is always something new. The action that you described in step 1 could look like this:

navigate to url: /one/one.app?v={{Now}}#/sObject/{{AccountId}}

The new auxiliary parameter here is “v” and its value is a UI-only field called “Now” on the Contact model. The UI-only field “Now” is a Display Type = Formula. The Formula behind the field is the function: NOW()

As result, the button click navigates to the URL of the respective Account and since the value of the field {{Now}} is never the same, because date and time change constantly, the page is forced to reload.

This is more likely a workaround. You could change the name of the auxiliary parameter. And you could adjust the Formula to something else, maybe only numbers is better than date/time format. The basic requirement is, that the value always changes to something new so that the page can’t be loaded from the cache.

Hmmm …  I seem to recall seeing a Skuid demonstration on this very thing. Change to Salesforce records using Skuid were reflected in Salesforce. Or was it from one Skuid page to another Skuid page. Not sure.

Definitely interested in this as well since I have a few clients starting to ask about migrating.

Thank you!  Will will try this approach.

Let us know as I’m sure it’ll be a necessity for many SF/Skuid  page menageries.

We re-watched Zach’s dreamforce presentation (that I saw live and remembered it as well) and seems that the event publish is for a Lightning component OR a Skuid page to publish events that other components on the page can pick up.  Not standard page components.

So, if we had a custom lightning or skuid based “add products to opportunity” component (override the New action on opp products), we saw two problems:

1) the overriden ‘New’ action would be a nav to a new page, not the nice/quick Salesforce native pop up that is fast.  Ehhhh… that’s a Lightning limitation, and an Idea is out there to implement it.
2) After adding products on my skuid page, we’d have an action to navigate back to the Opportunity Lightning page.  My Opp amount wouldn’t update.  Skuid and Lightning components can publish events to update other components on the same page (remember, mine forced me to navigate away) AND you can only put the listener on custom components (skuid or lightning) as well.  So I had no way to put a listener on my standard Opportunity Highlights panel, where the Amount sits. So even if I published an event, nothing was listening.

User would have to do a hard refresh of the page to see the updated amount.  So, this forced re-query redirect logic appears to be promising (although a tad hacky.)

Hacky indeed. It’s too bad standard lightning components doesn’t have a standard set of events they listen for. Kinda unbelievable.

Going to ask for an official response from Skuid on this. They for sure have been to the depths of the rabbit hole on this.

Hi Chandra, Pat, Jayesh, and Luzie,

Just to see what it would be like to try and trigger a Lightning Event from Skuid, I was able to make the force:navigateToURL work in my own developer org. By default, it will handle the input value as a relative URL (not absolute, like www.google.com). I explained this in a little more detail on Pat’s related post: https://community.skuid.com/t/any-ability-to-interact-with-standard-lightning-components

I’m not exactly sure how you might use this in your scenario Chandra, but I think this sounds quite promising.

Edit: I also wanted to mention that Jayesh’s suggestion of using force:refreshView might be worth trying. If not that, there might be another action Salesforce Lightning offers for this that I’m not aware of, but at least we know that it’s possible to trigger these kinds of events. 

Just an update - here is the full Event reference from Salesforce:

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_events.htm

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.

This isn’t working for me. I am trying to refresh the view of the standard case team lightning component after my skuid page has added a member to the case team. 

Ever figure this out?