+ Start a Discussion
sfdc18sfdc18 

Show error message on salesforce ui when rest callout fails

Hi,

I have a @future method in apex class and I am calling that method thro after insert trigger.
Rest callout code is present in the future method.
How to show error message on salesforce standard ui when rest callout fails?
Sri549Sri549
Hello,
As per your requirement,Showing up error message for future class in standard UI is not possible what i can say.
But there is a way to show up the status i.e. whether Succeded or failed by creating VF Page and Class and making that page in Inline VF Page.
When ever we refresh the page. This page gives the updated status.
Please reply if your need any clearance about the scenario or else Please mark it as a Best Answer for other Benefits.


Thanks
Srinivas
sfdc18sfdc18
Hi Shrinivas,

I am currently deleting the inserted salesforce record if the callout fails.
It returns standard salesforce message whenever I click on that record after callout
Message is "Record deleted. The record you attempted to access has been deleted. The user who deleted this record may be able to recover it from the Recycle Bin. Deleted data is stored in the Recycle Bin for 15 days."
Is there any way to customise this mesage.

OR as per your suggestion how to create that inline vf and class.
How to automatically delete that record after showing status in Inline VF page?

Thanks