Data source Connector - Nested Drill back
Hi,
I am trying to build a Drill back functionality in one of data source connector business rules. I tried looking into One Stream reference guide on Data Source connector business rules and I found below reference for nested Drill back functionality.
But practically when I tried to drill back on a drill back detail row, OS returns following message. The click on the drill back is not even calling the connector business rules any more.
Can someone help me with the ways to code with nested drill backs. I tried to follow the examples from Golfstream application.
Private Function GetDrillBackTypeList(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs) As List(Of DrillBackTypeInfo)
Try
'Create the SQL Statement
Dim drillTypes As New List(Of DrillBackTypeInfo)
If args.DrillCode.Equals(StageConstants.TransformationGeneral.DrillCodeDefaultValue, StringComparison.InvariantCultureIgnoreCase) Then
'Source GL Drill Down
drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.FileShareFile, New NameAndDesc("InvoiceDocument", "Invoice Document")))
drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialTypeDetail", "Material Type Detail")))
ElseIf args.DrillCode.Equals("BOMDetail", StringComparison.InvariantCultureIgnoreCase) Then
'Material Type Drill Down
drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllProducts", "Material All Products")))
drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllVendors", "Material All Vendors")))
End If
Return drillTypes
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
'Execute specific drill back type
Private Function GetDrillBack(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs, ByVal connectionString As String) As DrillBackResultInfo
Try
If args.DrillBackType.NameAndDescription.Name.Equals("InvoiceDocument", StringComparison.InvariantCultureIgnoreCase) Then
'Level 1: Show FileShare File
Dim drillBackInfo As New DrillBackResultInfo
drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.FileShareFile
drillBackInfo.DocumentPath = Me.GetDrillBackDocPath_L1(si, globals, api, args)
Return drillBackInfo
ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialTypeDetail", StringComparison.InvariantCultureIgnoreCase) Then
'Level 1: Return Drill Back Detail
Dim drillBackSQL As String = GetDrillBackSQL_L1(si, globals, api, args)
Dim drillBackInfo As New DrillBackResultInfo
drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
Return drillBackInfo
ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllProducts", StringComparison.InvariantCultureIgnoreCase) Then
'Level 1: Return Drill Back Detail
Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, True, False)
Dim drillBackInfo As New DrillBackResultInfo
drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
Return drillBackInfo
ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllVendors", StringComparison.InvariantCultureIgnoreCase) Then
'Level 1: Return Drill Back Detail
Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, False, True)
Dim drillBackInfo As New DrillBackResultInfo
drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
Return drillBackInfo
Else
Return Nothing
End If
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Thanks,
Mohan Alluri.
I was able to find the solution and it is to have a column with name called "DrillTypeCode" in the first drill back result. When you drill back again the connector will be called with ActionType as GetDrillBackTypes and args.DrillCode will have the value from the column "DrillTypeCode" of the row you are performing drillback.