VB Script : Getting WORKFLOW state transition "name"

Good morning,

I come to you because I can't in a VB code of automatic property naming to read the value of the workflow step.

I've tried various methods, but at best I'm reaping a -1 value.

This code made sense to me :

Dim IDWF : IDWF = GetPropertyID("Etape de Workflow") 'ID étape de workflow
Dim WF : WF = PropertyValues.SearchForProperty(IDWF).TypedValue.value 'l'étape de WF

Thank you in advance for your precious help

  • Hi Emmanuel,

    First we need to get the terms lined up. You have three elements:

    1. The workflow itself
    2. The workflow states - the steps inside the workflow
    3. The workflow transitions that lead from one state to another

    In the headline you ask for the transition name, but from the context it appears to me that you are looking for the state name. Is that correct?

    If so, the workflow state is managed in a built in property with ID 39. That means that you can simply use the DisplayValue of property 39 if you need the name of the current workflow state on the current object.

    To your code: There is no method "GetPropertyID" but there is one called "GetPropertyIDByAlias". However, you cannot use it built in properties because they have no Alias. So, your code could be as simple as

    Dim szWFstate : szWFstate = PropertyValues.SearchForProperty(39).TypedValue.DisplayValue