0

I have a future method (callout) and I would like to open a visualforce page to display if there are errors.

Is it possible?

For example :

@future(callout=true)
public static void doSomething()
{
    //callout code
    //after this callout code, if there is an error so should open vf page
}
4
  • 2
    Visualforce would be able to trigger future method by any action but results cannot be displayed because future methods are asynchronous by nature.
    – Raul
    Commented May 22, 2017 at 11:31
  • Thank you , Is there an another way to display errors to the user when a future function failed ? (For example , I could send mails but it is not so nice and there is also the problem of SINGLE_EMAIL_LIMIT_EXCEEDED)
    – Raphym
    Commented May 22, 2017 at 11:41
  • 2
    There's not really any way to do that. For all you know, the user already turned off their machine before the future method started running.
    – martin
    Commented May 22, 2017 at 11:57
  • 1
    One option would be to create task or activities to the parent record and use workflows to send email notifications.
    – Raul
    Commented May 22, 2017 at 12:51

0

You must log in to answer this question.

Browse other questions tagged .