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
Poorna Developer 13Poorna Developer 13 

Handling Web Service Response?

Hi Everyone,

What I have done?
 Trigger to get Record when it's generate JSON data and validate. And, send that JSON data as a setBody while  sending  HttpRequest. Once the response get from web service, need a help to handling web service response.

Requirement:
 My team have a requirements regarding API call, 
We have a pass HttpRequest in the form of JSON data.While, requesting to web service need data field validations like remove null and empty data, required fields should be filled or else throw an error in record page.  And, get back HttpResponse as JSON form.Once, get Reponse from web service need to handling the server response if response.GetStatusCode == 200 'success' or else need to stop the process and throw an error on the record page.



Any Suggestions?
 Thanks in advance.
Aparna JAparna J
In what format you are getting response?
Poorna Developer 13Poorna Developer 13
Hi Aparna,
  Thanks.
 I'm getting response in the JSON format.

I'm using  callout from trigger using future method. 
I need to return my response from the callout class. But, unable to return my response because of future method enable.