06-14-2023 02:27 PM - last edited on 06-14-2023 04:45 PM by JackLacava
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.
Solved! Go to Solution.
06-14-2023 05:25 PM - edited 06-14-2023 05:27 PM
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.
06-14-2023 04:36 PM
I've written about this in the Planning book with examples. You need to play around with your first drill and use that in the second.
06-14-2023 04:43 PM
Hi ckattookaran,
Can you point me to the examples you are referring to please?
Thanks.
06-14-2023 05:25 PM - edited 06-14-2023 05:27 PM
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.
09-20-2023 03:06 PM
Were you able to pull data from Drill Back Detail screen same as the one from Staging Area (sourceValues.Item(StageTableFields.StageSourceData.DimEntity)?
09-20-2023 04:04 PM
Yes, precisely you can use below statement.
args.GetSourceRowValue(StageTableFields.StageSourceData.DimEntity)
09-20-2023 04:08 PM
I mean from the Drill Back Detail as I need one field that is not in the Staging Area.
09-20-2023 04:16 PM
If you are working on nested drill back functionality you can always get the value of the field in a row with args.GetSourceRowValue("[column name]")
09-21-2023 03:02 PM
That worked! Thank for your help.
04-02-2024 11:40 PM
Hi! I'm trying to create something similar. Do you mind sharing step by step instructions please?
04-08-2024 09:05 AM
Hi,
Are you trying to do a nested drill back ?