Hi - I realized there was an Issue on that line of code, see it corrected:
Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id
Full Br:
'{GetDataSet}{DataSetName}{ScenarioTypeName=[Actual],Time=[|WFTime|]}
Public Function GetCubeViewMDData(ByVal si As SessionInfo, ByVal args As DashboardDataSetArgs, ByVal DataAdapterName As String) As DataTable
Try
'Gets data from the Cube View MD Data Adapter:
Dim objDataSet As DataSet = BRApi.Dashboards.Process.GetAdoDataSetForAdapter(si, False, DataAdapterName, "CubeViewMD", args.CustomSubstVars)
Dim dt As DataTable = objDataSet.Tables(0).Copy()
'Get args:
Dim ScenarioTypeName As String = args.NameValuePairs.XFGetValue("ScenarioTypeName",String.Empty)
Dim Time As String = args.NameValuePairs.XFGetValue("Time",String.Empty)
Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id
Dim TimeId As Integer = BRApi.Finance.Members.GetMemberId(si, dimtypeid.Time,Time)
'Loops through Table and pulls Text3
If (Not dt Is Nothing)
For Each srow As DataRow In dt.Rows
'Pull the Account Name (Should be pointed to the right Account Field Name ("Account"):
Dim AccountName As String = srow("Account").item
Dim AccountId As Integer = BRApi.Finance.Members.GetMemberId(si,dimtypeid.Account,AccountName)
Dim AccountText As String = BRApi.Finance.Account.Text(si,AccountId,3,ScenarioTypeId,TimeId)
'Repoints the Account Field for Text Property:
srow("Account") = AccountText
Next sRow
Return dt
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function