OnGlobalInsert in CU 1 doesn't work for object table

Lyuchin
Member Posts: 23
Hi nav community!
I need to track all changes within Nav objects. So I activated change log via Change Log Setup form for Object table and set Log Insertion, Log Modification and Log Deletion to All Fields. Then changed CU 1 adding MESSAGE in all OnGlobalXxx methods to test what will happen. Next I tried to test it. I created a new table, I expected message "Insert" b/c trigger OnGlobalInsert had to be caused. But nothing happend. After I tested all other actions (like renaming or deletion this table) and they work!
So my question is: why OnGlobalInsert trigger is not caused in the case of Object table, while it's working fine for all others tables provided that the change log is activated for these tables? And how to make to work it?
Thanks in advance! Will wait for your help.
I need to track all changes within Nav objects. So I activated change log via Change Log Setup form for Object table and set Log Insertion, Log Modification and Log Deletion to All Fields. Then changed CU 1 adding MESSAGE in all OnGlobalXxx methods to test what will happen. Next I tried to test it. I created a new table, I expected message "Insert" b/c trigger OnGlobalInsert had to be caused. But nothing happend. After I tested all other actions (like renaming or deletion this table) and they work!
So my question is: why OnGlobalInsert trigger is not caused in the case of Object table, while it's working fine for all others tables provided that the change log is activated for these tables? And how to make to work it?
Thanks in advance! Will wait for your help.
0
Comments
-
It's probably because you are not modifying the Object table directly. It is done by NAV, when you create or modify a table.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Implicitly, right. But why then delete, modify and rename work?0
-
If you try to insert the object by F3, it will work. But because you are using Wizard to create it, it will not work... this is my view on this...
Have you tried the rename/modify from within the designer itself or just by changing the field values in the object list?0 -
kine wrote:If you try to insert the object by F3, it will work. But because you are using Wizard to create it, it will not work... this is my view on this...
Have you tried the rename/modify from within the designer itself or just by changing the field values in the object list?
No no, I don't use any wizards. To test functionality I''m just trying to create any object, let's say Table, in the object designer by clicking on New button. After structure definition is done and object is saved, OnGlobalInsert have to be triggered (because a new record was inserted into Object table), but actually it has not.0 -
But still, I am not sure if it will help you, because you can edit the objects even when you have no company selected, but Change log is set per company... :-)0
-
there are tools in download folder that allows you track changes using sql triggers.
If you are on sql 2008, you can use sql tools to track changes on object table.0 -
Ok, I found workaround without using of navision. It is not actual now. Thanks all who replied.
Now I have another complex question: how to catch import of objects (File > Import...) in Navision. There is no correspond method to track import in CU 1. In other words I need certain track that import is done.0 -
Lyuchin wrote:There is no correspond method to track import in CU 1. In other words I need certain track that import is done.
You could create a dummy object (for example codeunit 90001) which you include with the other objects in the fob-file. Then you can check if this dummy object exists in the database, to know if the fob has been imported.
The 2nd fob will have codeunit 90002 as dummy object, which you can check to know if fob 2 has been imported. Etc.
I know this is not foolproof however.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Best is to use trigger on Object table on SQL. On Native you do not have this possibility...0
-
Lyuchin wrote:Now I have another complex question: how to catch import of objects (File > Import...) in Navision. There is no correspond method to track import in CU 1. In other words I need certain track that import is done.
If you're tracking from an SQL insert trigger all the objects in the import will be put into the database in the same transaction. If there's only one object you're kinda stuck, though you can catch some of them because the BLOB will be updated and the modified flag will be false. Maybe the modified time?
Just to be certain, there is NO way to make sure you can log everything from C/SIDE because changes to the object table can be made when you're not in a company and nothing will be called.
You can track every change from SQL but it's not always easy to interpret what triggered the change.
viewtopic.php?f=23&t=33344#p162604Robert de Bath
TVision Technology Ltd0 -
Lyuchin wrote:Ok, I found workaround without using of navision. It is not actual now. Thanks all who replied.
What was the work around?David Singleton0 -
David Singleton wrote:Lyuchin wrote:Ok, I found workaround without using of navision. It is not actual now. Thanks all who replied.
What was the work around?
Well, actually it is even not workarond but the solution with help another programming language, namely C#. Since it will be a tool with source control functionality, we use "bridge" written on C#, so that I used more wide possibilities of .net to solve this problem
About import, yes I agree that the only one possibility to track it is create trigger for Object table.
Thanks all again!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions