1

I am stuck with issue in Lightning. I want to do a field update on record page on click of a button, and will be showing a message to user on successfully updation of that field.

Lets say, I am doing this on Opportunity object. There will be a button on page layout, which will have some logic (if A then Alpha, if B then Beta) for updation of that status field and on click of button, it will update that field and will show a toast(even alert will be ok) to user.

Now, I am able to do this with existing ajax toolkit if we go by traditional approach. Even I succeeded in creating a lightning action, which will update a field(by taking its ID by using force:hasRecordId interface) based on some conditions and have added "window.location.relad()" in its controller to reload it.

However, ideally it should do things in background(without having a window), and refresh/reRender its detail page, so as to show the updated value and on updation, it should show a toast to user.

The main concern is -

  1. Displaying updated field on detail page(no VF/lightning component) without refreshing the page, so that I can show toast there.
  2. How to avoid component window, on click of lightning action on record detail page.

If you have any solution please let me know.

Thanks in Advance!

3
  • @Eric for #2, it can be a possible duplicate. However i hope it might have some solution to this. – Ysr Shk Apr 21 '17 at 18:22
  • This to me seems the exact use case for implementing recordchange detection using lightning data service (Developer only for now). Did you take a look at this? – Rao Apr 21 '17 at 19:22
  • @Rao Nope, I don't have idea about this. Actually we are having custom obj with custom approval process. So if one approver approves it, it should change its status, and the approve button is on record (which I will be migrating to lightning) – Ysr Shk Apr 22 '17 at 3:02