SIC ERP Connect Forum
Hi all,
I recently was going through a V8 upgrade and found that the documentation on ERPConnect with SIC was quite sparse. I hope this post helps anyone who might be struggling as I was a few days ago.
Smart Integration Functions in Version 8 + now must make all calls using ERPConnect and referencing Dlls stored on the SIC Server. Make sure you add your 'ERPConnectStandard20.dll' to the referenced assemblies property of the Smart Integration Function, this will allow ERPConnect and ERPConnect.Utils to be imported into your SIF. You will likely also notice there is no IntelliSense for 3rd Party Dlls for SIF, which makes things a little tougher. Use this link for specifics related to the ERP Connect API. ERPConnect.Utils.ReadTable - ERPConnect HelpCenter (theobald-software.com)
Smart Integration Function Snippet using ERPConnect
Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.Common
Imports System.Globalization
Imports System.IO
Imports System.Linq
Imports System.Text
Imports OneStreamGatewayService
Imports ERPConnect
Imports ERPConnect.Utils
Namespace OneStream.BusinessRule.SmartIntegrationFunction.SmartIntegrationFunction1
Public Class MainClass
Public Shared Function RunOperation() As DataTable
'Smart Integration Function
'Dim r3Conn = New R3Connection(v_host, v_instanceID, v_username, v_password, "EN", v_client)
r3conn.Protocol = ClientProtocol.NWRFC
r3Conn.Open()
Dim r3Table As New ReadTable(r3Conn)
'Manually create the list Of Fields For Global
r3Table.Addfield("<Insert Column Name>")
' 'Specify the table to open
r3Table.TableName = "<Insert Table Name>"
' 'Specify filters:
Dim whereClause As New StringBuilder(String.Empty)
' whereClause.Append("<Insert Where clause filters>")
r3Table.WhereClause = whereClause.ToString()
' 'Run Query
r3Table.Run()
Dim r3TableResult As DataTable = r3Table.Result
Return r3TableResult
Example Extender Rule calling the SIF (Smart Integration Function)
Namespace OneStream.BusinessRule.Extender.Test_SIF
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
Dim SIFparams(2) As Object 'Params passed to SIF
Dim rDto As RemoteRequestResultDto = BRAPI.Utilities.ExecRemoteGatewayBusinessRule(si, "<Insert SmartIntegrationFunctionBRName>", SIFparams, "<Insert Gateway Name>", "RunOperation")
If (rDto.RemoteResultStatus = RemoteMessageResultType.Success) Then
BRAPI.ErrorLog.LogMessage(si,"Connect success")
BRApi.ErrorLog.LogMessage(si, "Data Returned: " & rDto.ResultSet.Rows.Count)
Dim dt As DataTable
dt = rDto.ResultSet
Return dt
Else
If (Not (rDto.remoteException Is Nothing)) Then
BRAPI.ErrorLog.LogMessage(si,"Connect failed")
Throw ErrorHandler.LogWrite(si, New XFException(si, rDto.remoteException))
End If
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Please add on to this thread any comments or additional information related to upgrading to OneStream v8 with ERPConnect.