0

I have an issue where we have fields that a user may need to modify, but when they do we need the quote to be invalidated. I have developed a trigger for this purpose that uses metadata for the tracked fields.

When they modify the fields on the opp, the trigger fires and then moves the opp stage back to it's initial stage, however, the opportunity is not displayed with the new stage unless they refresh the page. I would like to make sure that the opportunity displays the new stage name after the trigger is done firing, without a user having to refresh.

Is there a way to do this? Thanks for your help.

Thanks,

15
  • 1
    are you using the standard page or custom?
    – Samir
    Mar 10, 2020 at 13:48
  • 1
    It should auto refresh once the save button is clicked. Are you doing the update in any async methods?
    – Samir
    Mar 10, 2020 at 13:59
  • 1
    where is your stage update happening? trigger or future method?
    – Samir
    Mar 10, 2020 at 14:04
  • 1
    Any async update will work like trigger, workflow, process builder.
    – Samir
    Mar 10, 2020 at 14:20
  • 1
    AFAIK - As far as i know.If your opportunity status logic is not dependent on quote logic, then you can update the opportunity in trigger and then call the future method. But if both the logic are dependent.. meaning, if any thing fails, there should be a roll back, then you need to write the whole logic in one place. I recommend using Process Builder. You can access child records in PB and this is OOTB feature.
    – Samir
    Mar 10, 2020 at 14:31

1 Answer 1

0

If you are using salesforce console then you can easily achieve this using salesforce push notifications:

Trailhead module below covers the concept in detail: https://trailhead.salesforce.com/en/content/learn/modules/service_console_customize/service_console_customize_push

This is not yet available on lightning: https://success.salesforce.com/ideaView?id=0873A000000lJYEQA2

one alternative to refresh the lightning page is

  1. In your trigger create a Custom Notifications with Platform Events https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_streaming

  2. Create a sample component which would subscribe to the event https://developer.salesforce.com/docs/component-library/bundle/lightning-emp-api/documentation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .