Solved

Why some of the Macros in Document Management do not work after an upgrade takes place from older versions to App9/App10 ?

  • 1 October 2019
  • 1 reply
  • 344 views

Userlevel 6
Badge +14
After migrating from old versions, some of the macros written using COM access provider do not work anymore.
icon

Best answer by Nayomi Wickramaarachchi 1 October 2019, 11:06

View original

1 reply

Userlevel 3
Badge +3
If your macro script made connections to Application Server via COM access provider, then they will not work anymore in App9/App10 as IFS does not provide COM Access Provider API from IFS Applications 9. .NET Access Provider is the recommended client based access provider in IFS.

However, for COM client users, IFS has provided an option to access .NET Access Provider while using a COM client.

As Macros make reference through creating objects by reference names, changing those reference name to be compatible with .Net Access provider would resolve this problem.
Note that IFS .NET Access Provider must be installed in client machine prior to executing macro such as mentioned in this case. Installation file for IFS .NET Access Provider.msi can be found in
instance\\client\runtime

Below is an example macro code written in VB.net to query the database using .NET access provider. There can be several ways to write this.

code:
Sub Main()
Dim oFndConnection, oSelectCmd
Dim text As String
Set oFndConnection = CreateObject("Ifs.Fnd.AccessProvider.FndConnection")
oFndConnection.ConnectionString = "https://**********:58080"
oFndConnection.SetCredentials "username", "password"
Set oSelectCmd = CreateObject("Ifs.Fnd.AccessProvider.PLSQL.FndPLSQLSelectCommand")
oSelectCmd.Connection = oFndConnection
Set oBindVarDesc = CreateObject("Ifs.Fnd.AccessProvider.PLSQL.FndBindVariable")
Set oFndTextAttr = CreateObject("Ifs.Fnd.Data.FndTextAttribute")
oFndTextAttr.SetValue "A%"
Set oFndDataTable = CreateObject("Ifs.Fnd.Data.FndDataTable")
oBindVarDesc.Direction = 0
oBindVarDesc.Name = "DESC"
oBindVarDesc.Value = oFndTextAttr
oSelectCmd.CommandText = "SELECT * FROM FND_USER WHERE DESCRIPTION LIKE :DESC"
oSelectCmd.BindVariables.Add (oBindVarDesc)
Set oFndDataTable = oSelectCmd.ExecuteReader()
For Each Row In oFndDataTable.Rows
text = text & Row.ToString()
Next
MsgBox text, vbOKOnly
End Sub

Reply