Skip navigation links

Package com.veeva.vault.sdk.api.picklist

This package provides interfaces to retrieve picklist information.

See: Description

Package com.veeva.vault.sdk.api.picklist Description

This package provides interfaces to retrieve picklist information.

Picklist field types are defined as a single-value or multi-valued field. A picklist field stores the name of each picklist value, and each name has a corresponding UI label.

The following example illustrates retrieving a single-value picklist field name and label:

     

      PicklistService picklistService = ServiceLocator.locate(PicklistService.class);
      Picklist authorityPicklist = picklistService.getPicklist("authority__c");

      List picklistValues = inputRecord.getNew().getValue("authority__c", ValueType.PICKLIST_VALUES);
      if (picklistValues != null && !picklistValues.isEmpty()) {

           //Get single-picklist value name selected by user
           String authorityPicklistValueName = picklistValues.get(0).toString();

           //Get picklist value label
           String authorityPicklistValueLabel =
           authorityPicklist.getPicklistValue(authorityPicklistValueName).getLabel();

           //Default name__v field with picklist value label
           inputRecord.getNew().setValue("name__v", "Auth: " + authorityPicklistValueLabel);
      }
     
 
Skip navigation links

Copyright © Veeva Systems 2017–2018. All rights reserved.