AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.06.2011, 18:06   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
In several partners meetings I have heard this requests over and over again.

Claus, when we are planning an upgrade of Classic reports to RDLC reports, we do not always know which reports are actually being used at the customer site. It would be great to be able to log which reports are used so we know exactly which reports we need to upgrade to RDLC.

Well, if you download below hotfix you will now have the capability to log report usage at a customer site.

Dynamics NAV 5.0: KB2558650 (Please allow a few days for 5.0 hotfix to be ready)
Dynamics NAV 2009: KB2556639

In the following steps I have outlined which steps you need to do to get this log file. Remember above hotfix is required to perform the following steps.

1. Create new table to be used for Log report usage:



OBJECT Table 50000 Report Log
{
OBJECT-PROPERTIES
{
Date=22-06-11;
Time=14:19:58;
Modified=Yes;
Version List=CLAUSL;
}
PROPERTIES
{
}
FIELDS
{
{ 1 ; ;No. ;Integer ;AutoIncrement=Yes;
MinValue=1 }
{ 2 ; ;User ID ;Code50 ;TableRelation="User Role"."Role ID";
CaptionML=ENU=User ID }
{ 3 ; ;Report ID ;Integer ;CaptionML=ENU=Report ID }
{ 4 ; ;Report Name ;Text249 ;FieldClass=FlowField;
CalcFormula=Lookup(AllObjWithCaption."Object Caption" WHERE (Object Type=CONST(Report),
Object ID=FIELD(Report ID)));
CaptionML=ENU=Report Name }
{ 5 ; ;Date Time ;DateTime }
}
KEYS
{
{ ;No. ;Clustered=Yes }
}
FIELDGROUPS
{
}
CODE
{
BEGIN
END.
}
}

2. Now with the table created for our Report Usage log please open Codeunit 1

3. Open “C/AL Globals”

4. Navigate to ”Functions”



5. Create new function with Name=”OnReportRun”



6. Open Properties and change ID to 120



7. Now open “Locals” and create parameter= ReportId with Type=Integer



8. Select Variables tab and create ReportLog



9. Now all we need is to write the code for this new trigger. Open C/AL Editor and navigate to the end.

10. In OnReportRun write the following code:

ReportLog."User ID" := USERID;

ReportLog."Report ID" := ReportId;

ReportLog."Date Time" := CURRENTDATETIME;

ReportLog.INSERT;



11. Now Restart Classic Client

12. Run a couple of reports

13. And then at last run the Report Log table to see the result:



Yes I’m aware that this solution only works for Classic Reports, and yes I also would like a feature so it’s possible for you to log all objects being used at a customer site. For now we do not get this, but let’s see what the future brings.

/Claus Lundstrøm



Источник: http://feedproxy.google.com/~r/Micro...ort-usage.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 19:47.