Veeva API¶
The iDetailAid Viewer also exposes the native Veeva JavaScript API, as well as a custom API specific to iDetailAid.
Native Veeva API¶
You can access the native veeva API from the slide code editor as you would normally:
com.veeva.clm.getDataForCurrentObject("Presentation", "Survey_vod__c", getSurveyQs);
iDetailaid Veeva API¶
There is also a iDetailAid namespaced API for custom veeva commands specific to iDetailAid.
Tip
These API calls return veeva data, and thus will only work once inside Veeva.
You will not be able to get any data from within the iDetailAid preview.
There are two API calls that mirror iDetailAid API calls, getCurrentPresentationSlides
and getCurrentPresentation
.
If you use the iDetailAd versions, you will get iDetailAid data structures back, but it will work in both the iDetailAid preview and in veeva.
See Viewer.api.getCurrentPresentation() and Viewer.api.getCurrentPresentationSlides()
Method name | description |
---|---|
getProducts | Gets a list of veeva products the current user has access to. |
getPresentations | Gets a list of veeva presentations the current user has access to, including thumbnail of first slide in each. |
getCurrentPresentationId | Gets the Salesforce ID of the current presentation. |
getCurrentPresentation | Gets some document fields for the current presentation. |
getCurrentPresentationSlides | Gets a list of veeva slides for the current presentation |
getPresentationSlides | Gets a list of veeva slides in a veeva presentation from it's Sales Force presentation id |
showVirtualSlide | Triggers a slide show event in the call clickstream for a 'virtual' slide |
hideVirtualSlide | Triggers a slide hide event in the call clickstream for a 'virtual' slide |
getMockConfig | Get a mock Veeva configuration object to help mock out configuration for local testing |
mockConfig | Inject a mock Veeva configuration object for local testing |
getProducts¶
Viewer.api.veeva.getProducts( callback )
Viewer.api.veeva.getProducts().then( success )
Gets a list of veeva products the current user has access to. Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the array of products |
getPresentations¶
Viewer.api.veeva.getPresentations( callback )
Viewer.api.veeva.getPresentations().then( success )
Gets a list of veeva presentations the current user has access to, including thumbnail of first slide in each. Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the array of presentations |
getCurrentPresentationId¶
Viewer.api.veeva.getCurrentPresentationId( callback )
Viewer.api.veeva.getCurrentPresentationId().then( success )
Gets the Salesforce ID of the current presentation. Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the id |
getCurrentPresentation¶
Viewer.api.veeva.getCurrentPresentation( callback )
Viewer.api.veeva.getCurrentPresentation().then( success )
Gets some document fields for the current presentation, including a thumbnail image path.
Tip
This returns veeva data, and thus will only work once inside Veeva.
However, you can use the iDetailAid API call Viewer.api.getCurrentPresentation(), that will return iDetailAid data, and will work in both the iDetailaid preview AND in Veeva.
Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the presentation |
getCurrentPresentationSlides¶
Viewer.api.veeva.getCurrentPresentationSlides( callback )
Viewer.api.veeva.getCurrentPresentationSlides().then( success )
Gets a list of veeva slides in for the current presentation.
Tip
This returns veeva data, and thus will only work once inside Veeva.
However, you can use the iDetailAid API call Viewer.api.getCurrentPresentationSlides(), that will return iDetailAid data, and will work in both the iDetailaid preview AND in Veeva.
Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the array of slides |
getPresentationSlides¶
Viewer.api.veeva.getPresentationSlides( sfPresentationId, callback )
Viewer.api.veeva.getPresentationSlides( sfPresentationId ).then( success )
Gets a list of veeva slides in a veeva presentation from it's Sales Force presentation id. Returns a Promise.
Argument | Type | Description |
---|---|---|
sfPresentationId | string | The Sales Force Presentation ID for the presentation |
callback | function | An optional callback function that receives the array of slides |
showVirtualSlide¶
Viewer.api.veeva.showVirtualSlide( id, description )
Start tracking a pseudo SLIDE VIEW event which will continuously be sent to the Veeva Call Clickstream.
The Clickstream object will be continuously updated with the duration of the view until either the main slide closes, hideVirtualSlide
or showVirtualSlide
is called again.
This can be useful when showing sub content in an HTML package which you want track as though it was a slide. See hideVirtualSlide
'
Argument | Type | Description |
---|---|---|
id | string | An id that you want to be mapped against the Call Clickstream object |
description | string | A description that you want to be mapped against the Call Clickstream object |
hideVirtualSlide¶
Viewer.api.veeva.hideVirtualSlide( id, description )
This will stop logging a pseudo SLIDE VIEW event to the Veeva Call Clickstream.
showVirtualSlide
must have been called first to start the timer. hideVirtualSlide
will then stop logging to the Call Clickstream. See showVirtualSlide
'
Argument | Type | Description |
---|---|---|
id | string | An id that you want to be mapped against the Call Clickstream object |
description | string | A description that you want to be mapped against the Call Clickstream object |
getMockConfig¶
Viewer.api.veeva.getMockConfig( callback )
Viewer.api.veeva.getMockConfig().then( success )
Get a mock Veeva configuration object to help mock out configuration for local testing. Returns a Promise.
Argument | Type | Description |
---|---|---|
callback | function | An optional callback function that receives the config |
mockConfig¶
Viewer.api.veeva.mockConfig( config )
Inject a mock Veeva configuration object for local testing.
Argument | Type | Description |
---|---|---|
config | object | A veeva config object. See |