The only reasonable route I see here, if the process for creating a Case is not under your control, is for your Lightning component to embed the <lightning:empApi>
event streaming service.
You can then either
- use the Streaming API to subscribe to notifications about record creation events or
- write an Apex trigger that implements custom logic on the creation of your Support Case records to fire a Platform Event, to which the
empApi
component subscribes.
Your JavaScript callback from the empApi component can then take action to refresh your activity view upon receipt of one of those events.
The only other feasible solutions I see are:
- Polling. I wouldn't recommend it.
- If and only if the data model permits - that is, if Support Case is a child object in a master-detail relationship - you could create a Roll-Up Summary Field and then use
<force:recordData>
to watch for change events in the parent object's roll up field, representing creation events for the child object. I think it's unlikely that that applies here.
If you have a custom tab then I'm sure you are able to check if you have the record's Id or not, which will determine the mode in which the component will operate (either "edit" or "create" mode).
After submitting the record, you'll need to fire the same functionality you have when you load the component, no? You don't necessarily need to refresh the whole page for that.
Suppose that your user navigates to the page, and the record is not created yet. They proceed to do so, and when the record is saved on the database, it will return the record's Id (you would get it in a callback in your JS helper). With the record's Id, you would be able to reload the content of the tab using the record's Id as reference for it to load the data, instead of displaying an empty form to the user (so it would go into "edit mode" instead of "create mode").
For one moment I thought about the "refresh view" event. But I believe that would be useful if you were in a standard page, or if the component implements the handler for said event. You'd call the event like this: $A.get('e.force:refreshView').fire();
. And then your component would implement a handler for it, like this:
<aura:handler event="force:refreshView" action="{!c.doRefresh}" />
Where doRefresh
is a method in your JS controller.
Best Answer
Why not create a lightning component and put your VF inside it as an iframe?
You lightning component will listen to refreshView event which is fired when some data on lightning changes? It will reload the page.
JS:
Also dont find to add the design file so that you provide the pageName and extra params from app builder.
Design: