cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing a drop-down keyword through workflow

Kathy_Ganswindt
Champ in-the-making
Champ in-the-making
Hey everybody, I'm trying to set a keyword within a VB script workflow for a keyword with drop-down options. Does anybody know how the keyword's options are referenced, so I can call a particular option from the dropdown list? Thanks so much!
8 REPLIES 8

Joe_Pineda
Star Collaborator
Star Collaborator

(...maybe you could post the code you have so far...)

Ok, then after you instantiate the current document, declare your keywords as variables, some simple Case statements should do it

Case xxx

kw=xx

case yyy

kw=yy

Thomas_Cupp
Employee
Employee

Hi Kathy,

Thanks for the additional information. It looks like your current approach, using VBScripting, is going to be the only way to accomplish what you want to do since you're using OnBase 11.

However, I would encourage you to keep the following in mind. In OnBase 12 we started to add significant functionality to Workflow where scripts can be replaced for common tasks by using Properties and Expressions within Workflow. The very thing that you're trying to accomplish could be replaced with 2 actions within Workflow now!

In the current version of OnBase, you'd use one action to copy the keyword that contains the Doc Type name into a Property using the "Set Property Value" action. Then, you'd use another action of "Set Document Type" and use the "Get Document Type from Property" setting on that action.

This is just a general statement for everyone that reads this post, but make sure you re-evaluate your existing scripts in Workflow to see if native Workflow functionality can replace them.

I wish I had more to contribute here. Unfortunately, I'm not a lot of help when it comes to scripting. However, now that we have a bit more context around what you're trying to do, I'm sure someone else here can help.

Thanks,

Thomas

Kathy_Ganswindt
Champ in-the-making
Champ in-the-making
Hey Jose, Excluding the variables, the script's only two lines of code - looks like this: strOBDocName = Left(obdoc.Name,InStr(obdoc.Name, "/")-6) //Here, we're just truncating the string at a set point and saving it as // a variable. obkeys.AddKeyword "LN RTL Doc Type", strOBDocName //Here, we just set the "LN RTL Doc Type" keyword to the value of the string. //The trouble is, when it's a Data-set keyword, this system doesn't work.I hope this clarifies. Thanks again for the help!

Joe_Pineda
Star Collaborator
Star Collaborator

hmmm... You may have to declare an array for the data set.... Anyways....

What happens if you try something like this?

------------------------------------------

With CurrentDoc '(whatever this object is)

Select Case strOBDocName

  Case Yellow

   obkeys.AddKeyword "LN RTL Doc Type", "Yellow"

Case Blue

    obkeys.AddKeyword "LN RTL Doc Type", "Blue"

etc

End Select

End With