---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# v_record - Scoped, Global

# v_record - Scoped, Global {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 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](https://www.servicenow.com/docs/access?context=create-remote-table-script&version=australia&pubname=australia-servicenow-platform&ft:locale=en-US).

Use v_record with the [v_query -- Scoped, Global](https://servicenow-prod.fluidtopics.net/2d4EJOgXMvOKhB5IB1PWMg#v_queryAPI "The v_query API provides methods to obtain information about a scriptable object that represents a query running against a remote table.") scriptable object to query remote tables, and the [v_table -- Scoped, Global](https://servicenow-prod.fluidtopics.net/S411RbLbHlKmdPn5cwMplA#v_tableAPI "The v_table API provides methods to add rows to a remote table through a scriptable object.") API to create remote tables.

## v_record - setLastErrorMessage(String lastErrorMessage) {#ariaid-title2}

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.
{#v_record-setLastErrorMessage_S__table_mlx_v4c_fdc__entry__3}

| 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 1. Parameters]

{#v_record-setLastErrorMessage_S__table_mlx_v4c_fdc} {#v_record-setLastErrorMessage_S__table_nlx_v4c_fdc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 2. Returns]

{#v_record-setLastErrorMessage_S__table_nlx_v4c_fdc}  
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.

