GetConnection
This is a specialized method similar to the EmbeddedProc object that could be used for getting the connection object to Microsoft Dynamics. The Dynamics client must be installed on the same machine. Use the ERP.BeginTrans and ERP.CommitTrans before and after the use of this method. This exposes the business functions but the programmer must know how to use them.
Group: System
Syntax: oValue = SYS.GetConnection(vSource)
oValue (Object) An object declaredConn as Axapta3 or Object, if you choose to use late binding. It will return the ADO, RDO, OLEDB, ERP, or Web connection object
vSource (Variant) data source name (DSN) or the data source number
Example:
Dim oConn As Axapta3
Dim oRecord As IAxaptaRecord
Set oConn = SYS.GetConnection("Dynamics")
Set oRecord = oConn.CreateRecord("INVENTJOURNALTABLE")
If oRecord Is Nothing Then
App.MsgBox "Error: Axapta Record object failed."
Exit Sub
End If
App.MsgBox "Record company: " & oRecord.company
Supported Versions: RFgen 4.0 and higher.