Categories

System version

6.05.95.85.75.65.55.4

Navigator.Extension.dll library

Introduction

In the Navigator system there is an option to add logic that cannot be defined from the application level. The Navigator.Extensions.dll library is used for this purpose. Thanks to it, you will be able to perform actions for specific activities in Business Navigator, such as saving a document or accepting a workflow step. In the case of a larger number of environments (production, test), each of them should have its own project.

Access to Navigator.Extension

The project attached to the application is covered by the version control system. By default, it should be in the application files. If the folder in the application files is missing, please contact the environment supervisor.

Navigator.Extension structure

The whole walk-through consists of two projects: Navigator.Extensions – the target library and Start – a project used to invoke methods and to test. The key is to connect the appropriate Navigator.Model library.

The library can be found in the application files folder in the bin folder

Navigator.Extension

The Navigator.Extensions library logic is contained in the Main method of the ExtendTran.cs class.

Call parameters:

  • Navigator.Model.Global.Database.SqlManager sql – this is a parameter communicating with the database connected to the application
  • Navigator.Model.Database.ETable table – information on which table you are operating on. Documents – To, contractors – What, etc. (Table abbreviations can be found in the Business Navigator Database Documentation)
  • string objectIds – Object identifiers separated by comma. For example, when performing the operation on two documents, you enter “1521, 1522”
  • Navigator.Model.DataBase.EType type – information about the operation performed on the object. Possible operations:
    • U – Update
    • A –  Add
    • D – Delete – the action is performed after the object is deleted
    • C – Click – the action is performed after pressing the button
    • SA – SaveAdd – the action is performed after the first save
    • SU – SaveUpdate – the action is performed after each save
    • WU – WorkflowUpdate – the action is performed after the circulation step
    • M – Menu – the action is performed after pressing the button from the menu level
    • AC – AddCopy – the action is performed after the object is copied
    • BD – BeforeDelete – the action is performed before the object is deleted
    • WAU – WorkflowAfterUndo – the action is performed after undoing the workflow step
    • AO – AfterOCR – the actions are performed when OCRing the document
  • int? buttonId – Identifier of the button whose actions are being called
  • int userId – ID of the user who performs the actions

The output parameter of the Main method is a string value that is used to display messages after the action is completed. The output string is derived from the Navigator.Model.Global.Message class. There are 3 types of message:

  • Success message
    • message = new Message (“The data has been saved”)
  • Warning message
    • Message = new Message (“The task is probably damaged”, EMessageType.Alert)
  • Error message
    • Message = new Message (“Attention! The amounts do not match”, EMessageType.Error)

It is also possible to interrupt an action performed by the program and prevent, for example, saving a document. You must then throw an exception:

  • throw new Exception (“The operation has failed”);
Start

In order to freely use and test the software solution in Navigator.Extenions, use the Start project. To configure, set the appropriate connection to the base in the App.config file in the connectionStrings section. You must provide server and database data.

The Program.cs class has been created to support Navigator.Extensions

Sample calls
  • ExtendTran.Main(sql, ETable.Do, “1”, EType.SU, null, 1);
    • Activation of the action on the Do table (Documents), on the object identifier 1, with the save operation type (SaveUpdate), by the user with identifier 1
  • ExtendTran.Main(sql, ETable.Co ,”8545″, EType.BD, null, 119);
    • Action calling on the Co table (Contractors), on the object identifier 8545, with the type of operation before deletion (BeforeDelete), by the user with the identifier 119
  • ExtendTran.Main(sql, ETable.Do ,”10816″, EType.C, 1845, 1);
    • Action call on the Do (Documents) table, on the object identifier 10816, with the operation type: clicking (Click) the button, with the button identifier 1845, by the user with the identifier 1

Connecting Navigator.Extension to the Business Navigator application

You have to remember that uploading the Navigator.Extensions library will log out all users from the application, therefore it is recommended to upload it after the working hours of employees. In order to upload, you need to build a project, and then open its location.

The library to be uploaded is in the bin -> Debug folder

Copy the library to the folder with the application. Navigator.Web -> bin folder

In order for the library to be automatically loaded into the application during the version update operation, the library should be added into the FilesToCopy folder.

Business Navigator API

The Navigator.Model library has an API (Navigator.Model.API) that allows you to download / save / modify data contained in the system. For writing new solutions, it is recommended to use only the methods contained in the API.

Menu