cancel
Showing results for 
Search instead for 
Did you mean: 

Scenario name from ScenarioKey

Afone
New Contributor III

Hi,

 

I am working with WorkflowClusterPk objects and I know I can get the ScenarioKey, which is an integer, like this:

Dim scenarioKey As Integer = si.WorkflowClusterPk.ScenarioKey

 

How do I get the scenario name (as a string) from the ScenarioKey? Is it possible?

Alternatively, which function could I use to get the current workflow scenario name?

 

Thank you

1 ACCEPTED SOLUTION

Afone
New Contributor III
I'll answer my own question. A command like this can be used:
Dim sScenarioName As String = BRApi.Finance.Members.GetMemberName(si, "2", scenarioKey)
 
I don't know why, but I had the idea the ScenarioKey was a different number than the MemberId (used in the GetMemberName function), but they are in fact the same thing!

View solution in original post

2 REPLIES 2

Afone
New Contributor III
I'll answer my own question. A command like this can be used:
Dim sScenarioName As String = BRApi.Finance.Members.GetMemberName(si, "2", scenarioKey)
 
I don't know why, but I had the idea the ScenarioKey was a different number than the MemberId (used in the GetMemberName function), but they are in fact the same thing!

Or a better option is to use ScenarioDimHelper.GetNameFromID(si,  si.WorkflowClusterPk.ScenarioKey). It works similarly to the TimeDimHelper function.