Skip navigation links

Package com.veeva.vault.sdk.api.job

This package provides interfaces to execute asynchronous jobs.

See: Description

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

This package provides interfaces to execute asynchronous jobs.

Change State

The following illustrates running a job to invoke a lifecycle user action to change state:
     
     //Get an instance of job for invoking user actions
     JobService jobService = ServiceLocator.locate(JobService.class);
     JobParameters jobParameters = jobService.newJobParameters("record_user_action__v");

     //Run job to invoke user action to change state
     jobParameters.setValue("user_action_name", "change_state_to_in_use_useraction__c");
     jobParameters.setValue("records", records);
     jobService.run(jobParameters);
     
 
The user_action_name parameter value, change_state_to_in_use_useraction__c, is from the configured lifecycle. It is derived by taking the lifecycle user action label in lower case, replacing any spaces with underscore, and appending _useraction__c.

The records parameter specifies the set of records to change state.

Start Workflow

JobService supports the following controls: Learn more about start step controls in Vault Help.

JobService cannot start a workflow from a RecordAction with the LIFECYCLE_ENTRY_ACTION Usage.

The following illustrates running a job to invoke a lifecycle user action to start a workflow.

     
     //Get an instance of job for invoking user actions
     JobService jobService = ServiceLocator.locate(JobService.class);
     JobParameters jobParameters = jobService.newJobParameters("record_user_action__v");

     //Run job to invoke user action to start workflow
     jobParameters.setValue("user_action_name", "evaluate_country_brand_useraction__c");
     jobParameters.setValue("records", records);
     jobParameters.setValue("review_date__c", LocalDate.now().plusMonths(1));
     jobService.run(jobParameters);
     
 
The user_action_name parameter value, e.g. "evaluate_country_brand_useraction__c", is from the configured lifecycle. It is derived by taking the lifecycle user action label in lower case, replacing any spaces with underscore, and appending _useraction__c. Note that your vault may name actions differently. To get the names of actions in your vault, Retrieve Object Record User Actions with the Vault REST API.

The records parameter specifies the set of records to start the workflow.

Skip navigation links

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