When the execution of the Oracle Forms USER_EXIT Built-in subprogram is complete, an integer value is returned to Oracle Forms. This integer value indicates whether the USER_EXIT Built-in subprogram executed with success, failure, or a fatal error. (For example, if you are creating a foreign function in C, Oracle Forms provides the constants in a ".h" file.)
Error variables in Oracle Forms--FORM_FAILURE, FORM_FATAL, and FORM_SUCCESS--are set according to the value that is returned from the USER_EXIT Built-in subprogram. You can query the error variables to determine the success or failure of the execution of the USER_EXIT Built-in subprogram just as you would for any Built-in subprogram. The trigger that calls the USER_EXIT Built-in subprogram determines how to handle the return condition.
For example, you might want to check the value of FORM_SUCCESS after executing a foreign function from a user exit:
User_Exit('my_exit');
IF NOT Form_Success THEN
/* handle the error */
END IF;
Passing parameter values to a foreign function using USER_EXIT
Returning a value from a foreign function using PL/SQL example