Skip to main content
Veeva Support APAC Labor Day May 1 - 5th - Limited staff, please plan accordingly



Welcome to Community

Can vault SDK trigger a change object state?




  • John Choo

    Hi James,

    No, it is not possible to change the state of a record through Java SDK. I've experienced the same issue. What is your scenario?



  • Richard Pater



    Yes, it is possible to change an object's state, but you cannot just directly update the state__v field.  You need to initiate a user action.  Check out the documentation for Package com.veeva.vault.sdk.api.job:





  • James Huang

    Hi, Richard

    I am working on the object state change SDK, and tried the following code from Vault JDK documents: 


         //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);


    I have the following questions:

    1. Do I need to create a JDK user action as record action first and hand over to Vault JDK job service to execute or I can use Vault configured user action to complete the state change without JDK record action?

    In the above code, the 3 parameters referring to:

    1. record_user_action__v
    2. user_action_name   I am not sure where to find this parameter from Vault configuration and insert here. 
    3. change_state_to_in_use_useraction__c   Is this the state the user want to change to?
    1. If I don’t need to create JDK record action, how do I find the user action name in Vault configuration?
    2. It seem that the Vault API documents are outdated and I can not import Package com.veeva.vault.sdk.api.job, instead I have to import the following



    I am not sure if I did something wrong.


  • James Huang

    Hi, Rich

    I am getting really closer now. I have an user action with label Change State to Approved. As per the instruction from the Java DSK documentation, I constructed the user_action_name parameter as change_to_approved_in_use_useracton_c, I run the the program and it give me the following error message:

    "This Java SDK code error caused by: [Unknown User Action [approved_useraction__c] specified"


    Please advise how to correct this.


    Many thanks!



  • James Huang

    Rich and Choo.

    Just share  with you folks. I solved this issue. I was able to change the state of a records based on the user action as per Veeva SDK documentation. The early error is caused by user action name is too long and get truncated. When I shorten the user action name, it works fine.



  • Ritika Ratan Gupta

    Hi James,


    I m also looking for this option and i m facing some issues while calling a user action with job services.

    Can you share you snip code that will be very helpful , and i will see if that work for me. 


    Thanks and Regards,

    Ritika Gupta


Please sign in to leave a comment.

Powered by Zendesk