Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
16%
200 - 500 GB
27%
500 - 800 GB
3%
800 - 1200 GB
11%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
19%
Total votes: 37

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 2nd February 2004, 14:11
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Question Standard fields to show user who changes records?

Hello,

Are there any standard fields available in Baan that will show when a record was added or last changed and by which user?

Thanks

PJ
Reply With Quote
  #2  
Old 2nd February 2004, 14:50
zardoz's Avatar
zardoz zardoz is offline
Guru
 
Join Date: Jan 2003
Location: Torino, Italy
Posts: 445
zardoz is on a distinguished road
Baan: Triton 2, Triton 3, Baan IV, Baan ERP, Baan LN - DB: Oracle, Tbase, MS Sql - OS: Unix, Windows
You can get this information only via audit files.
__________________
My company
Reply With Quote
  #3  
Old 2nd February 2004, 15:21
tools123 tools123 is offline
Senior Member
 
Join Date: Aug 2002
Posts: 146
tools123 is on a distinguished road
Baan: 4c4 - DB: informix - OS: unix
depends on the table the record got added to

Depending on the Table / Session used to add/ update the record, you may actually find it under that table or a history table associated with it.
sometimes custom tables are designed to record this in the background

if these are not present, then audit files are the places to look.
Reply With Quote
  #4  
Old 2nd February 2004, 16:16
Neal Matthews's Avatar
Neal Matthews Neal Matthews is offline
Guru
 
Join Date: Sep 2001
Location: Nottingham
Posts: 483
Neal Matthews is on a distinguished road
Baan: Baan IVc4 ags0 - DB: Informix 9.40 UC4 - OS: Sun Solaris 9
tdsls050 and tdpur050 are the only tables I've ever used with the user field on it.

Our previous system used to contain a user and date time stamp shown at the bottom of the screen on all static data. Something which the users miss due to the ability to quickly track any problems associated with static data issues to a department.

Now these issues have to be solved via audit which means IT always have to have an involvement.

Cheers
Neal
Reply With Quote
Sponsored Links
  #5  
Old 2nd February 2004, 17:52
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Thanks.....

...for your comments.

I have found a solution.

In my table I will create some additional fields for 'Record Added' and 'Record Updated' and then have a trigger on the table which will update these fields. The only field I can not have is the one relating to the user as we have one Oracle user to many Baan users.

Thanks again.

Regards

PJ
Reply With Quote
  #6  
Old 2nd February 2004, 18:37
tools123 tools123 is offline
Senior Member
 
Join Date: Aug 2002
Posts: 146
tools123 is on a distinguished road
Baan: 4c4 - DB: informix - OS: unix
=========
The only field I can not have is the one relating to the user as we have one Oracle user to many Baan users.
=====
what exactly do you mean by this?
if you have a new field say 'usrt' or any other name in your table,you can write a simple program to update that field everytime someone modifies a record.
the user name is present in 'logname$' at any time.
Reply With Quote
  #7  
Old 2nd February 2004, 19:44
nneilitz's Avatar
nneilitz nneilitz is offline
Member
 
Join Date: Feb 2002
Location: Midland, TX
Posts: 40
nneilitz is on a distinguished road
Baan: IVc4sp15+ - DB: Oracle 8.1.6.3 - OS: HP-UX 11.11 (11i)
Pjohns is referring to using oracle triggers, all system users within baan generally have the same oracle username (depending on the implementation). But you can actually get the user id by retrieving the os user. I attached some samples from triggers we did on purchasing and item master. The triggers populate new custom tables (I prefer this to adding on to BaaN standard tables, it is a little cleaner).

CREATE OR REPLACE TRIGGER TTDPUR041100_UPDATE
BEFORE UPDATE ON TTDPUR041100
FOR EACH ROW
DECLARE
username varchar2(15);
BEGIN
select osuser into username from v$session where audsid = (select userenv ('sessionid') from dual);
IF :old.T$ITEM <> :new.T$ITEM OR :old.T$OQUA <> :new.T$OQUA
OR :old.T$CWAR <> :new.T$CWAR OR :old.T$PRIC <> :new.T$PRIC OR :old.T$DDTA <> :new.T$DDTA THEN
insert into ttdpur941100 values ( :new.T$ORNO,:new.T$PONO,'UPD' , sysdate,username,:old.T$ITEM,:new.T$ITEM,:old.T$OQUA,:new.T$OQUA,:old.T$CWAR, :new.T$CWAR, :old.T$PRIC,:new.T$PRIC,:old.T$DDTA, :new.T$DDTA,0,0);
END IF;
END TTDPUR04100_UDPATE;

CREATE OR REPLACE TRIGGER TTDPUR041100_INSERT
BEFORE INSERT ON TTDPUR041100
FOR EACH ROW
DECLARE
username varchar2(15);
BEGIN
select osuser into username from v$session where audsid = (select userenv ('sessionid') from dual);
insert into ttdpur941100 values ( :new.T$ORNO,:new.T$PONO,'ADD' , sysdate,username,:new.T$ITEM,:new.T$ITEM,:new.T$OQUA,:new.T$OQUA,:new.T$CWAR, :new.T$CWAR, :new.T$PRIC,:new.T$PRIC,:new.T$DDTA, :new.T$DDTA,0,0);
END TTDPUR04100_INSERT;



CREATE OR REPLACE TRIGGER TTDPUR041100_DELETE
BEFORE DELETE ON TTDPUR041100
FOR EACH ROW
DECLARE
username varchar2(15);
BEGIN
select osuser into username from v$session where audsid = (select userenv ('sessionid') from dual);
insert into ttdpur941100 values ( :old.T$ORNO,:old.T$PONO,'DEL' , sysdate,username,:old.T$ITEM,:old.T$ITEM,:old.T$OQUA,:old.T$OQUA,:old.T$CWAR, :old.T$CWAR, :old.T$PRIC,:old.T$PRIC,:old.T$DDTA, :old.T$DDTA,0,0);
END TTDPUR04100_DELETE;
Reply With Quote
  #8  
Old 3rd February 2004, 11:59
pjohns's Avatar
pjohns pjohns is offline
Guru
 
Join Date: Aug 2001
Location: Surrey - UK
Posts: 554
pjohns is on a distinguished road
Baan: IVc4 SP31 with HiDox - DB: Oracle 11.2.0.2 - OS: RHEL 5.8
Spot on nneilitz!

This is exactly what I want!

Thank you

PJ
Reply With Quote
  #9  
Old 3rd February 2004, 18:34
nneilitz's Avatar
nneilitz nneilitz is offline
Member
 
Join Date: Feb 2002
Location: Midland, TX
Posts: 40
nneilitz is on a distinguished road
Baan: IVc4sp15+ - DB: Oracle 8.1.6.3 - OS: HP-UX 11.11 (11i)
Notes
You will need to add access to the V$SESSION table to the standard baan user for this to work.

The modify function, along with the table definition of the custom audit table will need to be changed according to what fields you want to audit changes (in our case we are only auditing 3). In any case the field order must match the custom table. (in this case tdpur941)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background info for bshell options (BaanIV) victor_cleto Tools Administration & Installation 61 26th January 2010 19:17
Zoom Session for selection bklunder Tools Development 1 27th November 2003 08:25
User Information fields amarpreet About Baanboard.com 1 16th July 2003 10:04


All times are GMT +2. The time now is 22:55.


©2001-2018 - Baanboard.com - Baanforums.com