0

I am updating a field on an object from calling future handler in before update trigger, but field value is not get updated on UI. I have to refresh my detail page to see the updated changes. Can I refresh my page through the apex trigger in anyways? When I query from the database its showing updated value, but not on UI.

Any suggestions...Please help!!

1 Answer 1

1

That's not how Salesforce is designed to work.

When you update a field - it's done through a synchronous transaction. When Salesforce executes the transaction, committing your updates to the database it also execute the trigger logic (before / after) synchronously and after all this is finished - your UI will refresh.

Now - if your trigger calls @future method - this method executed asynchronously - which means it will run in a separate transaction that will execute after the previous one is finished.

If you want the result of your async callout to be visible on your screen immediately, you should choose some other solution than wiring the callout to trigger.

1
  • Thanks @Maciek Simm
    – Prachi
    Jun 18, 2020 at 15:56

You must log in to answer this question.

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