0

I configured a Lightning Component for Lightning Experience Record Pages by implementing force:hasRecordId. My component performed an update on the current record using an Apex controller and the refresh the view page using $A.get('e.force:refreshView').fire(); when I click on a button.

It works fine, I have the standard record detail component + my custom lightning component on the same record page. When I click on a button on my custom lightning component the standard record detail component is refreshed with the updated values.

My problem is that if the user is inline-editing the standard record detail component, and click on the button of my custom lightning component the record is updated but the $A.get('e.force:refreshView').fire(); doesn't work and the standard record detail component is still in edit mode without the modified values. When the user clicks on the save button he has the error message:

This record was modified by xxx during your edit session. Make a note of the data you entered, then reload the record and enter your updates again.

So it there a way to fire the save event of the standard record detail component before updating the record in my custom lightning component or to detect that the standard record detail component is editing in my custom component in order to display a warning message.

Thanks a lot.

  • Not putting this in as an answer as I have not tried it myself. Have you tried firing the force:recordSaveSuccess event? This may 'trick' the standard component into refreshing/reverting to its standard state. – S Morgan Robertson Sep 5 '17 at 14:56
  • What object are you operating on ? Is this behaviour specific to an Sobject ? Reason being : I came across KI for Collision detection when operating on Leads. – StormBr34ker Sep 5 '17 at 15:06
  • I am displaying the Case standard record detail component in addition to my custom component. – djmat Sep 5 '17 at 15:10
  • thinking out loud: have you tried using lightning dataservice for record manipulation or listening to changes? I suspect the same issue might occur though. – Christian Szandor Knapp Nov 15 '17 at 20:52
0

It looks like you may be able to do this a release or two:

EDIT: The v41 (winter) docs preview makes it look like these will be GA. So a month or so more!

  • Interesting but it doesn't solve my problem. I need to detect events / status (inline editing) of the standard record detail component, not of another tab. – djmat Sep 11 '17 at 9:55
  • Also, those links point to the service console api - question seems related to lightning record pages in general – Christian Szandor Knapp Nov 15 '17 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.