Querying database for who created new entity in database

Question Status

Suggested Answer
Fausat asked a question on 18 May 2018 9:06 AM

Dear All,

Please I need help on how to query the database to reveal user name of the person that created a new legal entity in my organisation database. I've tried to run simple query involving SYSDATABASELOG using search criteria like DATAAREAID and DESCRIPTION of the new company name , which brought up user names that made changes to the new entity but this has not returned information relating to the person that created the entity in the first instance.

I need ideas on what script can be run that will reveal the user id that created the new company and the date it was created. 

Thanks

Fausat

Reply
Suggested Answer
Heinz Schweda responded on 18 May 2018 10:32 AM

Hello, take a look into table CompanyInfo. I think there you will find your entity and the CreatedDateTime and CreatedBy.

Regards,

Heinz

Reply
Suggested Answer
Sukrut Parab responded on 18 May 2018 12:58 PM

If you have not enabled created by and Created date time on company info then those fields are not going to help. If you enabled database logging on insert then you should be able to get what you need from COmpanyInfo table.

Reply
Fausat responded on 21 May 2018 6:02 AM

Hi Sukrut,

Thanks for your contribution. On the companyinfo table, I could see the companies but as you rightly mentioned no created by and created date on the table. So i still don't know who created and date created. Please how can I enable the database log to include these fields . Thank you

Reply
Fausat responded on 21 May 2018 6:06 AM

Hi Heinz,

thank you for your contribution. As mentioned by Sukrut below the created by and created date fields are not enabled so still couldn't get the information from the companyinfo. Any help on how to enable the database log to include this field.

Thanks

Reply
Suggested Answer
Sukrut Parab responded on 21 May 2018 5:33 PM

Hi Fausat,

Please check below link to learn about how to enable database logging

technet.microsoft.com/.../dd362089.aspx

Reply
Heinz Schweda responded on 22 May 2018 3:39 AM

Hi, i'm suprised that createdBy and createdDateTime are not enabled...however...to enable these fields for a table, you need to set the properties CreatedBy and CreateDateTime to YES (so you have to customize your environment). And because table CompanyInfo is derived from DirPartyTable, you have to modify the table DirPartyTable.

Regards

Heinz

Reply
Suggested Answer
Heinz Schweda responded on 18 May 2018 10:32 AM

Hello, take a look into table CompanyInfo. I think there you will find your entity and the CreatedDateTime and CreatedBy.

Regards,

Heinz

Reply
Suggested Answer
Sukrut Parab responded on 18 May 2018 12:58 PM

If you have not enabled created by and Created date time on company info then those fields are not going to help. If you enabled database logging on insert then you should be able to get what you need from COmpanyInfo table.

Reply
Suggested Answer
Sukrut Parab responded on 21 May 2018 5:33 PM

Hi Fausat,

Please check below link to learn about how to enable database logging

technet.microsoft.com/.../dd362089.aspx

Reply