You need to sign in to do that
Don't have an account?
sfdc18
Open Visualforce Page through @future method
Hi,
I have a @future method Display().
I want to open visualforce page after executing callout code from future method.
@future(callout=true)
public static void display()
{
//callout code
//after this callout code, this method should open vf page
}
I am calling this future method thro' after insert trigger.
I have a @future method Display().
I want to open visualforce page after executing callout code from future method.
@future(callout=true)
public static void display()
{
//callout code
//after this callout code, this method should open vf page
}
I am calling this future method thro' after insert trigger.
try somthing like this
Thanks
Shaijan
This seems not to be possible :
when you call a future method, there is no return (void return type), and the navigator is not the client, the method is executed "when Salesforce has available resources" see SF doc about future anotation here (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_future.htm).
So the platform executing the @future method cannot know who to send the response, and so the redirection.
Hope this helps
Gil
Question Solved ? Please mark as the best answer to help other users !
What should I do then.
Actually my scenario is, whenever callout fails it should display some custom error message on visualforce page
Thanks
If the you are in a VF page with a controller, you can make the callout directly into the controller, and display the message (you are in a controller context, so your browser is the client) in VF page with <apex:messages /> tag.
Then you save the record only if the callout is successfull.
Hope this helps
Gil
Question Solved ? Please mark as the best answer to help other users !