Forum Discussion
- OSAdminValued ContributorOriginally posted by Nick Bolinger
Rob, give this a try. I tested writing to the error log and it gave me the cube name and account dim name that I expected.
'Get cube name from WF
Dim wfUnitInfo As WorkflowUnitInfo = api.Workflow.GetWorkflowUnitInfo()
Dim wfName As String = wfUnitInfo.ProfileName
Dim wfprofileInfo As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, wfName)
Dim cubeName As String = wfProfileInfo.CubeName
'Cube Account Dim can vary by scenario type
'Set scenario based on Workflow
Dim scenarioType As ScenarioType = api.Workflow.GetScenarioType()
'Set dim type to Account
'Get cube info to query the account dim ID
Dim dimType As DimType = DimType.Account
Dim cubeToQuery As CubeInfo = api.Cubes.GetCubeInfo(cubeName)
Dim dimID As Integer = cubeToQuery.Cube.CubeDims.GetDimId(dimType.Id, scenarioType.Id)
'Set dimPK
Dim pk As New DimPk(dimType.Id, dimId)
'Get account dim and Dim Name
Dim AcctDim As [Dim] = api.Dimensions.GetDim(pk)
Dim dimName As String = AcctDim.Name
'For testing
'brapi.ErrorLog.LogMessage(si, ""Cube = "" & cubeName & "" dimName = "" & dimName)
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 3 years ago
- 2 years ago