Q:

How do I return a value from a callout method to a trigger so that I may validate field values against a web service?

I'm trying to validate a particular field on insert or update against a web service. Before the record is saved, the data is sent over to the web service, and it returns a Boolean indicating whether the input is valid.
I started by writing some APEX code, but received an error indicating that callouts cannot be done from inside a trigger. With a bit of research, I found recommendations to move the callout logic into a separate class, add the @future (callout=true) annotation, and call it from the trigger.
Now, however, I am receiving yet another error indicating that Future methods cannot return a value.
Is this possible?

A:

You can't perform web-service validation in a trigger, which means you cannot do real-time validation in this fashion nor stop the transaction from being committed based on web service results.
Future methods execute in a separate, asynchronous transaction, from which you cannot return values. The same is true of other types of asynchronous Apex, such as Queueables and Batches - they cannot synchronously return values to the code that initiated their action.
You could potentially perform this type of validation in a custom user-interface layer, whether in Visualforce or in Lightning, prior to actually initiating the save operation. Alternately, you could perform the validation asynchronously and surface an error through some other method, such as sending an email or marking a status value on the record, but would not be able to show the user an error during their save operation.

