SBX - Search With Button

SBX - Forum Post Title

Querying database for who created new entity in database

Microsoft Dynamics AX Forum

Fausat asked a question on 18 May 2018 9:06 AM
My Badges

Question Status

Suggested Answer

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
Heinz Schweda responded on 18 May 2018 10:32 AM
My Badges
Suggested Answer

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

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
My Badges

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
My Badges

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

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
My Badges

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
Heinz Schweda responded on 18 May 2018 10:32 AM
My Badges
Suggested Answer

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

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

Hi Fausat,

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

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

Reply

SBX - Two Col Forum

SBX - Migrated JS