function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Refresh a page after insert.



I have a trigger on Opportunity who is working pretty well!
But my user have to press F5 (refresh) to see the Opportunity line item updated on the opportunity page.


Does any way exist to update the opportunity page after the (after insert) trigger.



My trigger has a Future annotation 





Santosh KumbarSantosh Kumbar

@future annotation : makes execution Asychronous.. Is it neccassary for your requirement? 


It delays your field population after insert...






I'm doing an http call so it's necessary to have a future annotation 


@future would mae an asynchronous call So it isnt possible. However you can make use of chatter notifications to let user  know that the record has been updated and may be provide the link to the opportunity. with @future you cannot be 100% sure that how much time it would take to update.


Use @future only when it is most important.You cannot make a direct callout from trigger


Only option I see is to move the code from triggers where the callout restriction exists and put it into a visualforce page. If you need the logic in both places (because API updates need to process the logic) you could leave it in the trigger and just not enqueue the async method if the callout has been processed already (assuming that's all you need to do in the async method) .


Generally, however, putting things off to async is a very good idea so I would resist the request unless there is a very good business reason to make it synchronous. 


Thanks for your help, but if i don't use any trigger my users will have to make one more action isn't it?


How can i put my request in a page?

yamini cs.ax1485yamini cs.ax1485


In my code am not using @future method

My trigger will fire and doing insert operation.

After that i need a page to refresh.

Instead of refrest is there any possiblity to page refresh automatically.

Thanks in Advance