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

Show error message on salesforce ui when rest callout fails


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?
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.

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?