Log Changes of the Object Table

Is it possible to log changes made to Object table. Change Log doesn’t allow to do this. Any suggestions?

You are using 3.60, correct? The Object table is not in the list of tables. At least in 3.70 the Object table is in the Change Log Setup (Table) List. Maybe you can do a technical upgrade to 3.70? But that’s pretty much all I know about it. Wait for a second opinion. [;)]

Yes, 3.60. I’m glad about 3.70 [:)] What exactly I have to upgrade to get the Object table listed and logged (!) in the Change Log? I tried to import Change Log forms and tables from 3.70 but it didn’t work at all (The Object table was listed but no changes were logged).

Just remember one thing here. If you database has more than one company, then you might got problems unless. ou allways develop in the same company. Otherwise you must turn the change log on in all companies, but then you’ll not get a consolidated change log.

Thnx Erik! I will keep it in mind. But here’s another problem: I got the Change Log Setup to list Object table but it logs only changes made directly in the Object table. So if object is created or modified no changes are logged. Only when I delete an object (directly from the Object table) log entries appears. Is there any other way to log changes made to objects?

Whilst on the subject of change log… We have a little problem where a record maybe indirectly updated from a modify trigger and the change log doesn’t pick up this change. We could add a function to manually log these changes, but I was a little annoyed the system doesn’t automatically do this. Have I missed something or is there something else that I can do?

Hi Alex, You are absolutelty right on that one, it will not pick anything up that is done through code, which is probably also the reason why Arthur’s solution will not work. It only records user actions, not indirect changes through code or even the object import routine. We suffered from this when we put nice little history buttons on most of our forms which then open the filtered change log in a new window. We also had to write code to show changes that were done indirectly through code or it would miss out half the changes. This works very well though, users can now see all changes made, regardless of whether it was done through code or user interaction. Loads of works though if you want to do this for many areas, so better be selective. Hope this makes sense Meint

If MBS just could give us three functions in codeunit 1 which where called when an object was created, changed or deleted. Then You culd add code there to take care of the change log…

which would then make a nice start to a object version control system which is something we have been wanting for ages. Why something so essential is missing from such a complete system is absolutely beyond me, but MBS must have their reasons (like not finding a suitable system to acquire and cannabalise)… We have looked at using external tools to do this job, but it is just too cumbersome to import/export all the time (and we have work to do). What we need is something relatively simple which records who made a change, when and forces the developer to document. As a bonus, it would keep track of what was changed (lines changed, added, deleted etc), allow roll-back at the press of a button and help out with multi-linual development. Surely not too much to ask :slight_smile:

We have made our own logging system for some of our larger databases. It doesn’t automatically log objects which have been changed, however it does bring up a filtered lists of todays or this weeks objects for example. You then can write comments against each object and allocate a release number. This proves very useful when looking back at a release six months ago as it will have the comments etc outlining what changes were made. It also adds the release number to the start of the version list which allows u to see all the release that that particular object was involved in.

quote:


Originally posted by Arthur
Thnx Erik! I will keep it in mind. Is there any other way to log changes made to objects?


Hy Arthur! Are you using the SQL Server Option for 3.60 ? If so, you could log the changes directly from SQL. All you have to do is put triggers on system tables in that database, so that you can monitor only the changes you`re interested in.[:D] Also, you are going to find a table there named “Object” that contains all the objects in Navision: forms, tables etc.[;)]

I doubt that you can log changes to the Object table - C/AL knows really nothing about it, and C/SIDE is not doing the change log stuff. The SQL option is much more flexible in this area, but there is much room for improvement in the future.

Another “problem” with the Change Log functionality is really that you cannot set a change log to tables with Data common to all companies!!

quote:


Originally posted by robertc
I doubt that you can log changes to the Object table - C/AL knows really nothing about it, and C/SIDE is not doing the change log stuff. The SQL option is much more flexible in this area, but there is much room for improvement in the future.


Actually, it is possible to catch changes to the object changes, but this only works in SQL. We (well someone that used to work for the company I work for) wrote a little SQL table trigger to check a customer ‘check out’ table for the object number and the user currently logged on, and insert a record in the table if it doesn’t find one. If it does, then it won’t let you save the change and throws a SQL Server exception, which is handled in Navision. To release the object for someone else to work on, you simply delete the check out record, something only the logged user can do. So even though it’s not a ‘version control’ system, I know exactly which objects are being worked on just by opening the check out table, whioch then gives me a list of the objects and the users who have them checked out. Plus it saves me a lot of heartache, because I can check the object out just by opening it in design mode and sacing it. If someone else has it, it won’t let me do that, and if I’m the first, it’s checked out for me.

This is the flexibility I was referring to - SQL triggers can do a lot for you totally outside of Navision if that is what you’re comfortable with. You can also add fields to the Navision tables (such as the Object table) - Navision won’t be upset about new fields, provided no constraints you might set on the fields are violated by Navision activity.