Automating adding the same code to hundreds of reports

JosephGress
Member Posts: 36
I have a project where I will need to add the same code to several hundred reports in NAV. And, I may need to do this in several databases.
I am looking for the best way to automate this process.
The code is very simple: declare a global variable then add 2 or 3 lines of code to the OnInitReport trigger in each report.
I've noticed in NAV2009 that you can export objects in xml format. I suspect that this may be the way to go for this project. However, I am relatively new at working with XML.
My questions are:
1) Are there other approaches that you have used to automate adding the same code to many objects in NAV?
2) I know there are many tools that are available for working with XML data. What tools do you recommend for my project? Also, let me know if you are aware of any books or online documentation that were helpful for you in learning to use these tools.
3) Are there any gotchas that I should look out for in doing this project?
Thanks
Joseph
I am looking for the best way to automate this process.
The code is very simple: declare a global variable then add 2 or 3 lines of code to the OnInitReport trigger in each report.
I've noticed in NAV2009 that you can export objects in xml format. I suspect that this may be the way to go for this project. However, I am relatively new at working with XML.
My questions are:
1) Are there other approaches that you have used to automate adding the same code to many objects in NAV?
2) I know there are many tools that are available for working with XML data. What tools do you recommend for my project? Also, let me know if you are aware of any books or online documentation that were helpful for you in learning to use these tools.
3) Are there any gotchas that I should look out for in doing this project?
Thanks
Joseph
Joseph Gress
0
Comments
-
Based on your description I fear you are trying to do something that can be done very simple.
http://dynamicsuser.net/blogs/mark_brum ... usage.aspx
How is my guessing? :?:Regards
Peter0 -
Thanks PDJ and Mark! :thumbsup: PDJ guessed exactly what I was trying to do--recording when a report was last used; who used it; how often it was used and so on. That was great information.
Mark's blog posting about adding code to the FindPrinter function in Codeunit 1 works beautifully for reports.
Now, I want to do the same thing (record when they were last used, etc) for forms and dataports. Unless I'm missing something, the same trick won't work for these objects.
So, I'm back to my original questions:
1) Are there other approaches that you have used to automate adding the same code to many objects in NAV?
2) I know there are many tools that are available for working with XML data. What tools do you recommend for my project? Also, let me know if you are aware of any books or online documentation that were helpful for you in learning to use these tools.
3) Are there any gotchas that I should look out for in doing this project?Joseph Gress0 -
Did you consider setting up Change Log? Surely you don't want to know EVERY time a form is used, and you are focused on key fields?0
-
Regarding Aseigle's question "Did you consider setting up Change Log?", that might work for forms that are not readonly. I will test adding the code to add an Object Usage record to the GetGlobalTableTriggerMask function in Codeunit 1.
Thanks for the suggestion!Joseph Gress0 -
I would try using security on form level.
By default Navision allows users to use form 0 in the ALL role.
I don't like that.
My advise to customers is to setup security on all objects, not only tables. This way you can also see which objects are really used.
You can start with adding all forms to one ALLFORM role and start stripping slowly.
If an user cries that something does not work, it's fixed in 5 seconds.0 -
-
-
Thanks Mark for the suggestion of using security to find out whether certain forms are being used or not. I have mixed feelings about that approach. On the one hand, it is easy and fast to implement and I think it would be pretty effective. On the other hand, it prevents users from trying out forms that they haven't used before. I think that if a user doesn't have rights to a given form they don't see it in their menu. It could lead to the same form being created multiple times. But it is simple.
Thanks again.Joseph Gress0
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