I am using standard table 405(Change log entry) to display all modifications done for aay company by any user and for one functionality. And I am using one customized table for specifying users.
I have made a Report for displaying records form Table 405 for all the users specified in my customized table.
Now my client wants that my report should not display company specific data rather he wants me to display data for all the comapnines together when he runs that report form any comapny.
for eg I have two companies A and B. So he wants that when I run my report from company A it should display data from comapny B also and vice versa.
0
Comments
create temporary table
set company for record with record.CHANGECOMPANY
copy all records to temporary table
this do for all companies
and than print/show it
I think of three ways:
1) extra dataitem based on company table
This way, you're looping the company table. In the OnAfterGetRecord of that dataitem, you can do a CHANGECOMPANY of the Change Log Entry.
Disadvantage is that you won't be able to group the data in a decent way. The report is grouped on company level.
2) same as above, but filling a temp table (based also on the Change Log Entry). After that, print your report based on that temp table. Grouping is flexible in this way.
You can do all this in one report.
3) Make your table "DataPerCompany" = No and my be add a field and fill it with the company name (if needed). I don't know how this is going to end up, but it seems feasable... .
Disadvantage is that users in different companies is going to lock each other because they're all working in the same table.
I would go for option 2.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
If you are on SQL, you can create View as union of all tables for all companies and add it into NAV as LinkedObject. Than you can create the report over this... (in the view you can add one field with name of the company to have unique identification...)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog