I have a VF Page embedded on a Record-Home Flexipage in LEX. I'm using my own VF-Container-Iframe-LightningComponent to host it, but since using the magic parameter
isdtp=p1 I get the platform provides me the
sforce.one object, which can do very powerful things such a opening a popup to edit existing records:
It works like a charm and it looks like that
Now when I press save is see this green toast:
But I found now way to trigger that this happen in order to execute an additional JS-function. I need that, because I have a Visualforce List and I use the
sforce.one.editRecord() to modify records shown in the list. Of course after updating a record, I want to reload the list automatically to make sure that the user does not see any obsolete data.
What I have tried so far is just to call a function after the the invocation of
sforce.one.editRecord() like this
sforce.one.editRecord() acts asynchronously and return immediately and the console.log() is executed immediately and not after edit.
Is there any way to hack something to invoke a function after the edit has been completed?
I suppose that
sforce.one.editRecord() is just a wrapper for the underlying
Now I found here How to find out when force:editRecord dialog is closed after saving changes? that it could be worth to try these events
which I could subscribe in my VF-container-IFRAME-LightningComponent (thank god I have used my own one!). But before I start a massive trial-and-error-session I would like to ask you guys if someone has successfully invoked anything "after save" either in a custom LC or in VF. In the other question above it seem unclear to me, if any of those events catch the SAVE properly. When I get some generic recipe, I can figure out the rest on my own.
I need the same for Lightning Components
Also I have the very same scenario in pure LCs: we often calculate standard Name fields by trigger or by ProcessBuilder. Now we can't get rid of the damn Name field in the layout, because it's required. Neither can we prepopulate it using the Standard "New" Button in LEX. Now overriding the New-Action with a custom LC, again I would need a way to act (reload, refresh, update) AFTER the SAVE has been executed.
So this question applies to VF as well as to LCs.