Skip to content

Veeva API

The iDetailAid Viewer also exposes the native Veeva JavaScript API, as well as a custom API spefific 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
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

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

Viewer.api.veeva.mockConfig()