I'm trying to call a helper BR that I wrote to pull in two variables to denote our environment, but I'm getting an error message saying the extender business rule.MainClass is undefined.
Background...
Update. I've solved the problem of not being defined, but run into a new problem. In order for the called rule to be defined, I need to specify it in the receiving rule's properties. Done. Now I'm getting the error in the attached image. This is in the Connector rule which is the receiving rule.
But the code from my helper BR --which is an Extensibility rule-- validates just fine.
Namespace OneStream.BusinessRule.Extender.JDE_EnvironmentHelper
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
'get the Connection String - function below
Dim connectionString As String = GetConnectionString(si, globals, api)
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
#Region "Connection String Name" 'Create a Connection string to the External Database
Private Function GetConnectionString(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer) As String
Try
Dim gateWay As String = "JDE_DEV_Gateway" 'Dev connection pointing to DEV
'Dim gateWay As String = "JDE_Proj_Gateway" 'Dev connection pointing to PROJ
'Dim gateWay As String = "JDE_Data_Gateway" 'Prod connection pointing to PROD
Dim envTbl As String = "crp" 'DEV
'Dim envTbl As String = "proj" 'PRJ
'Dim envTbl As String = "prod" 'PRD
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
#End Region
End Class
End Namespace
How do I get my connector to recognize this as part of the Main class OR, what do I use in my helper instead of GetConnectionString to create my private function? I've been struggling to figure out what else to use that would be part of Main class. As you may have guessed by now, by VB skills are rudimentary.
The external variable or function you are calling needs to be Public if it is to be seen outside the logic file. In other words, you need to change GetConnectionString() to be Public.