Categories

System version

6.26.16.05.95.8

Library Navigator.Extension.dll

Introduction

System Business Navigator has the ability to add logic unable to define from within the app. For this purpose is used library Navigator.Extensions. Thanks to this, we will be able to perform actions for specified activities in Business Navigator, such as saving the document or approving the workflow step. In case of a larger amount 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. To gain access to it, you need to contact the environment guardian.

Structure of Navigator.Extension

The whole solution consists of two projects: Navigator.Extensions – targeted library and Start – project used for calling methods and testing. Crucial is attaching a proper library Navigator.Model.

We can find the library in the folder with application files in the folder bin.

Navigator.Extension

The logic of Navigator.Extension library is concluded in the method Main class ExtendTran.cs

Parameters of calling

  • Model.Global.Database.SqlManager sql – is a parameter communicating with the base attached to the application
  • Model.Database.ETable table – information on which table we are operating. Documents – Do, counterparties – Co, and so on. (We can find shortcuts to the tables in the Documentation Data Base of the system Business Navigator
  • string objectIds – Object identification, separated by a comma. For example, performing operations on two documents, we give “1521, 1522”
  • Model.Database.EType type – information about a performed operation on the object. Possible operations:
    • U – Update
    • A – Add – adding
    • D – Delete – action is performed after deleting the object
    • C – Click – action is performed after pressing the button
    • SA – SaveAdd – action is performed after the first save
    • SU – SaveUpdate – action is performed after each saves
    • WU – WorkflowUpdate – action is performed after the workflow step
    • M – Menu – action is performed after pressing the button from within the Menu
    • AC – AddCopy – action is performed after copying the object
    • BD – BeforeDelete – action is performed before deleting the object
    • WAU – WorkflowAfterUndo – action is performed after undoing the workflow step
    • AO – AfterOCR – actions are performed while OCRing the document
  • Int? Buttonld – identifier of the button which actions we are calling
  • Int userld – identifier of the user who performs the actions

The output parameter of the Main method is the value in the form of a string, which serves to display messages after finished action. The output string is created based on class Navigator.Model.Global.Message. There are 3 possible types of messages.

  • Success message
    • Message = new Message(“Operation completed successfully”)

  • Warning message
    • Message = new Message(“Warnign! Assignment might be broken”, EMessageType.Alert)

  • Message about an error
    • Message = new Message(“Warning!Amounts do not match!”, EMessageType.Error)

There is also a possibility to break off the performed by the program action and not allow to, for example, save the document. You must then throw an exemption:

  • Throw new exception(“Operation was unsuccessful”);

Start

To freely use and test the solution programmed in Navigator.Extensions you need to use the project Start. For configuration, you need to set a proper connection to the base in the file App.config in section connectionStrings. You need to give the data of the server and the database.

For using Navigator.Extensions was created class Program.cs

 

Exemplary calls

  • Main(sql, ETable.Do, „1”, EType.SU, null, 1);
    • Calling action on the table Do (Documents), on identifier object 1, about operation type save (SaveUpdate), by the user with an identifier 1
  • Main(sql, ETable.Co ,”8545″, EType.BD, null, 119);
    • Calling action on the table Co (Counterparties), on identifier object 8545, about operation type before deleting (BeforeDelete), by the user with identifier 119
  • Main(sql, ETable.Do ,”10816″, EType.C, 1845, 1);
    • Calling action on the table Do (Documents), on identifier object 10816, about operation type pressing button (Click), about identifier button 1845, by the user with identifier 1

 

Business Navigator system API

Library Navigator.Model has in itself the API (Navigator.Model.API), allowing to download/ save/ data modification, included in the system. For writing new solutions, it is recommended to use only the methods included in the API.

 

Plugging Navigator.Extension under application Bussiness Navigator

To plug in the library under our app, you need to build project Navigator.Extensions, and then open its localization.

The library for uploading is in the folder bin -> Debug

Having a prepared library, we open the module “Settings -> Personalization -> Extensions” and then find the already existing file Navigator.Extensions and edit it, selecting our prepared library.

 

 

 

 

 

 

Menu