v_record - Scoped, Global

  • Release version: Australia
  • Updated March 12, 2026
  • 1 minute to read
  • The v_record API enables you to sets an exception or error message on a remote table record. Remote tables allow you to retrieve data from external sources or from another instance with REST or SOAP services.

    This API executes wherever GlideRecord create, update, and delete methods are used in a script with no changes to workspaces or lists and forms.

    This API requires the Remote Tables plugin (com.glide.script.vtable) to be activated. For more information, see Create script definitions for a remote table.

    Use v_record with the v_query – Scoped, Global scriptable object to query remote tables, and the v_table – Scoped, Global API to create remote tables.

    v_record - setLastErrorMessage(String lastErrorMessage)

    Sets an exception or error message to display during editable operations on a remote table record in the form or list view, and in system logs.

    Note:
    v_record represents the remote record on which the insert, update, or delete operation is executed, therefore no tables are updated as a result of using this method.
    Table 1. Parameters
    Name Type Description
    lastErrorMessage String Exception or error message to display as the last error or exception in the remote table record. Displays on the form or list view, and is written to the system log.
    Table 2. Returns
    Type Description
    None

    The following example sets the exception message "Exception encountered executing the insert" to display during editable operations on a remote table record:

    (function executeInsert(v_record) { 
       try{ 
    //add logic to insert the record in the remote table 
       } catch(ex) { 
          v_record.setLastErrorMessage("Exception encountered executing the insert");
       } 
    })(v_record); 
    (function executeUpdate(v_record, v_changed_fields) { 
       try{
    //add logic to update the record in the remote table from the changed fields in 	
    // v_changed_fields 
       }catch(ex) { 
          v_record.setLastErrorMessage("Exception encountered executing the update"); 
       } 
    })
    (v_record, v_changed_fields); 
    (function executeDelete(v_record) { 
       try{ 
    //add logic to delete the record in the remote table 
       }catch(ex) { 
          v_record.setLastErrorMessage("Exception encountered executing the delete"); 
       } 
    })(v_record);

    Output:

    "Exception encountered executing the insert"

    The output is the exception message that was set using setLastErrorMessage() when there is an exception in the operation performed on the remote system (such as insert, update, delete). If there is no exception returned, the operation is considered a success.