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
Veeru AVeeru A 

REST Callout in Visualforce ONBLUR

I need to call an external REST service in a VF EDIT Page (I have one created from scratch...not Standard Page) and update an Inputfield. This is all to be done before a record is saved either through a button on the page or ONBLUR

I already have a functioning APEX class doing the callout if that is a better approach than doing it directly in the page. I am not sure the page will proxy out right or not or if there will be a CORS prob if its not done in the APEX Class. 

Anyway...looking for some ideas on how to best implement this. 

Thanks for any thoughts or even better short examples!! ;) 
KevinPKevinP
You'll need to basically do the following:

use an Apex:actionFunction tag to wrap your apex method in a js method.
attach that newly created apex:ActionFunction as the onBlur handler for your field.