Creating and Updating Records from CLM
The createRecord, updateRecord, and updateCurrentRecord JavaScript functions can be used to capture data for custom and Veeva-defined objects. Since application logic and validation are not executed when using these functions, all content must be rigorously tested before publishing into production.
These JavaScript functions support attachment fields, allowing content creators to create and update records with long text strings from CLM content. The long text strings are stored as .txt files in Vault CRM with a maximum size of 1.2 MB.
Who can use this feature?
- iPad, Windows Users
- Users do not require an additional license
- Business Admin Users, Content Creator Users, End Users
Configuring Attachment Fields for Creating and Updating Records from CLM for

- Navigate to Admin > Configuration > Objects > VMobile Object Configuration > Layouts.
- Place the Include Attachment Field List (include_attachment_field_list__v) field on the appropriate layouts.
- Navigate to Admin > Users & Groups > Permission Sets.
- Select the appropriate permission set.
- Select the Objects tab.
- Grant the following permissions:
Objects Object Permissions Object Types Fields Field Permission vmobile_object_configuration__v
R
tablet__v
include_attachment_field_list__v
Read

To configure this feature:
- Navigate to Admin > Users & Groups > Permission Sets.
- Select the appropriate permission set.
- Select the Objects tab.
- Grant the following permissions:
Objects Object Permissions Object Types Fields Field Permission vmobile_object_configuration__v
R
tablet__v
include_attachment_field_list__v
Read
- Navigate to Business Admin > Objects > VMobile Object Configurations.
- Navigate to the VMOC for the applicable object.
- Define the attachment fields in the include_attachment_field_list__v field. This is a double semi-colon delimited list. This ensures specific attachment fields sync to end user devices.
- Ensure the VMOC is Active.
Creating and Updating Records Upon Exiting CLM

Content creators can use the following functions to allow end users to save information to Vault CRM when navigating between slides or exiting CLM:
- createRecordsOnExit()
- updateRecordsOnExit()
- updateCurrentRecordsOnExit()
Do not use the createRecord function to create call2_key_message__v records. Doing so interferes with Veeva-defined logic for call key messages.
To help format these functions, use the following helper functions to return strings for use with the OnExit functions:
- formatCreateRecords(object array, values array)
- formatUpdateRecords(object array, record array, values array)
- formatUpdateCurrentRecords(object array, values array)
The exit functions cannot include alert or confirmation dialogues requiring user interaction.
Content must be written to Vault CRM objects using the API. Local storage is not supported.
Attachment fields are not supported for the OnExit and format functions. Additionally, custom attachment fields are not supported on the user__sys object.
Sample code
com.veeva.clm.updateCurrentRecordsOnExit = function() {
var object1 = Account;
var values1 = {};
values1.Preferred_Statin__c = Juvastatin!;
var object2 = KeyMessage;
var values2 = {};
values2.Customer_Field__c = Saved information;
var objectArray = [object1, object2];
var valuesArray = [values1, values2];
return com.veeva.clm.formatUpdateCurrentRecords (objectArray, valuesArray);
}