Article Details
Id:13164
Product:finPOWER Connect
Type:NEW
Version:2.03.01
Opened:28/07/2015
Closed:29/07/2015
Released:07/08/2015
Job: J015991

Scripts; Shared (Static) version of finPOWER Connect business layer now available for use in private Classes

Private classes within finPOWER Connect Scripts are unable to use the finPOWER Connect business layer (finBL).

A new Shared (or Static in C#) version of the business layer (and the ScriptInfo object) are now available, e.g.:

Option Explicit On
Option Strict On

Public Function Main(parameters As ISKeyValueList) As Boolean
  
  Dim t As Test

  ' Assume Success
  Main = True
  
  t = New Test()
  t.ShowVersion()

End Function


Private Class Test
  
  Sub ShowVersion()

    finBLShared.DebugPrint("Version: " & finBLShared.Version)

  End Sub
  
End Class

A C# version of the above is shown below:

public bool Main(ISKeyValueList parameters)
{
  bool Main;
  Test t;

  // Assume Success
  Main = true;
  
  t = new Test();
  t.ShowVersion();
  
  // Function should return a Boolean value indicating success
  return Main;
}

private class Test
{
  public void ShowVersion()
  {
    finBLShared.DebugPrint("Version: " + finBLShared.Version);
  }
}

NOTE: Page Sets and Account Application Type Scripts can also access a finBLShared property however, since these inherit from a standard base class, ScriptInfoShared is not available to these Scripts.