Object Manager
Repository
Repository is used when you want to save your objects outside NAV. You can save your objects in a repository like TFS or File System. Every time an object will be checked-in in the Object Explorer the object will be send to the repository. You can use the repository with and without synchronization. The option with synchronization is used if you want to sync separated databases. Every change that is done in one database is also executed in all other databases that are connected to the same repository.
Repository without Synchronization
Use Repository | Set this flag if you want to use a repository. |
---|---|
Repository Type | The type of the repository. One of the following options can be chosen:
|
Repository Path | The local path that the repository is using to save the files. |
Username | The username that is used to login to the repository. |
Password | The password that is used to login to the repository. |
Assign Mods. Before Check-in | Before you check-in an object you have to assign the modifications on this objects to a project. This prevents that these modifications have to be assigned in each database individually. |
Export Object Format |
|
Archive Objects | Each time an object changes a copy of this object will be saved to the archive directory in the repository. |
Archive Projects | Each time a project changes a copy of this project will be saved to the archive directory in the repository. |
Archive Transport | Each time a transport changes a copy of this transport will be saved to the archive directory in the repository. |
Create Repository
When you create a repository all the directories are created in the repository and a token will be placed in the root. The directory structure looks like this:
Export
With this option all objects, projects and transports will be exported to the repository.
Import
This option imports all objects, projects, transports and locks from the repository.
Lock Repository
Locks the repository. This places a file with the name LOCKED in the root of the repository. Nobody can read or write to the repository until somebody unlocks the repository
Unlock Repository
Unlocks the repository. The file with name LOCKED will be deleted from the root of the repository.
Repository with Synchronization
Synchronize Databases | Use this option to enable synchronization between databases. |
---|---|
Last Read Token No. | The token number that is last read. This field is used to prevent that a specific token is read 2 times. |
Global Last Token No. | The last used token number of the repository. This is directly read from the repository. If this field is empty then the repository cannot be reached. |
Auto Synchronize | Use this option to poll if something changed in the repository. If something changed these modifications are automatically imported in your database and executed. |
Seconds Between Auto Sync. | Seconds between each time the repository is checked for new changes. |
Token Duration | Seconds that a token is seen as valid. If one of the connected users sees that your token is busy for this number of seconds it is killed and you get a warning that the token duration has to be increased.If you use a repository that is on a WAN or internet then it can be necessary to increase this value. |
Delete Log when Processed | Each modification will be saved to a log table. If you enabled this option these records will be deleted after they are processed |
Test Connection
The connection to the repository will be tested. If something is wrong you will get a detailed error message.
Connect
Sets the Last Read Token No. to the token number of the repository. Use this option if you want to connect to an existing repository but you do not want to process the log. It is highly recommended to import all objects, projects, transports and locks from the repository before you connect to an existing repository.
Synchronize
This option processes all pending log records.
Check-out and Check-in Objects
If you use a repository it is highly recommended to enable the SQL check that an object can only be changed if it is locked. You can enable this setting in the setup by setting At Modifying Object to Error if not locked. Now it is prevented two developers are working on the same object.
Before you can change an object you first have to check-out this object from the repository. You can do that in the Object Explorer by pressing the Lock Object button or Ctrl + L:
It is also possible to select more objects at the same time and lock them together. Now you can see that the object gets a blue color. In other databases you can see that the object has a grey color and that the user that has locked the object is shown next to the grey square. What technically happens in the background is that the token has got a new number:
A lock file is placed in the locked directory with the credentials of the user that has locked the object:
A copy of the locked object is placed in the object directory.
Every modification that involves the repository is logged in the log directory. This is done through FAB files. All the other databases check the token in the main directory and if there are new log files they are imported and processed.
Modifying Project and Transports
If you change a project or transport this modification is immediately saved to the repository. If two developers are modifying the same project the following error appears and the modification is rolled back.
Exporting and Importing
If you export data to the repository it is not placed in the log so it is not automatically read by the other databases.
Exporting and Importing Objects
If you want to ex- or import all objects you can use the functions on the Repository Panel. If you want to ex- or import one object or a couple of objects you can use the repository functions in the Object Explorer.
If you try to import an object that is newer in your database you will be warned.
Exporting and Importing Projects
If you want to ex- or import all projects you can use the functions on the Repository Panel. If you want to ex- or import one project or a couple of projects you can use the repository functions on the Project Card or the Project List.
Exporting and Importing Transports
Similar to ex- and importing projects.
Place Action in Repository
All the data actions that you do with the Action Worksheet can be placed in the repository so that the action will also be executed in all other databases. If e.g. you want to delete a field from a table you first have to empty that field. If you only empty the field in your own database and remove the field all the users in other databases will get the following error.
And if they process the log manual they will get the following error.
So it is important that you first export an action to empty the field to the repository before you save the object.
Renumber an Object
If you simply rename an object in your database this will not be noticed by the other connected databases and they will try to insert the renamed object which will result in two objects with the same name.
And if they process the log manual they will get the following error.
To prevent this it is recommended that you renumber an object always with the Renumber Objects tool and that you copy this renumber action to the repository before checking in your modifications.
Renumber a Field
A field in a table cannot be renumbered if there is data present in this field. If you do so you will get an error like this.
If you renumber a field in your own database all the other connected databases will also be confronted with this error. To prevent this you have to use the “Renumber Fields” functionality and copy your renumber actions to the repository.All the other databases will now renumber the field without any problems.
Related content
IDYN 2024