Sunday, May 26, 2013

Dynamics GP - Custom Activity Tracking Reports - Auto-Enable Activity Tracking

Activity Tracking Log Table is

select * from dynamics.dbo.sy05000

Scheduled SQL Job to enable activity tracking for all users


update Dynamics.dbo.SY60100
set TRKUSER = 1 
where TRKUSER = 0
print 'Changed : ' + str ( @@ROWCOUNT )


Original Post here


View to only show the last 2 years of activity log
---------------------------------------------
/****** Object:  View [dbo].[BI_ActivityLog]    Script Date: 3/8/2018 10:27:22 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[BI_ActivityLog]
AS
SELECT        INDEX1, PRODNAME, CMPNYNAM, USERID, INQYTYPE, DATE1, TIME1, SECDESC, DEX_ROW_ID, (YEAR(GETDATE()) * 12 + MONTH(GETDATE())) - (YEAR(DATE1) * 12 + MONTH(DATE1)) AS MthsOld
FROM            dbo.SY05000
WHERE        ((YEAR(GETDATE()) * 12 + MONTH(GETDATE())) - (YEAR(DATE1) * 12 + MONTH(DATE1)) <= 24)

GO
-------------------------------------------------------------

Codes

InqTypes
1=user failed login
2=user logging in
3=user accessed form
4=user denied login
5=user accessed report
6=user denied report
7=user added master record
8=user modified master record
9=user deleted master record
10=user used process server
11=user added utility record
12=user accessed file maintenance
13=user denied file
14=user accessed routines
15=user logged out
16=user went into modifier
17=user went into report writer
18=user added transaction record
19=user deleted transaction record
20=user modified transaction record
21=user added setup record
22=user deleted setup record
23=user modified setup record

Index Series Numbers:
2=Financial 
3=Sales 
4=Purchasing 
5=Inventory 
6=Payroll 
7=Project

1 comment: