Creating and Updating Records from CLM
- CRM Desktop (Mac, Windows)
- iPad
- iPhone
The createRecord and updateRecord 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.
Do not use the createRecord function to create Call2_Key_Message_vod records. Doing so interferes with Veeva-defined logic for call key messages.
Content must be written to Veeva CRM objects using the API. Local storage is not supported in any CLM content.
Creating and Updating Records Upon Exiting CLM
Users can save information to CRM when navigating between slides or exiting CLM. Content creators can use the following functions to implement this functionality:
- createRecordsOnExit()
- updateRecordsOnExit()
- updateCurrentRecordsOnExit()
These functions are available on iPad only. The standard onUnload JavaScript function can be used on Windows.
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.
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);
}