Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Enabling createdby fields on D365 tables

(1) ShareShare
ReportReport
Posted on by 66
Hi all,
 
I've recently received a change request to enable CreatedBy/CreatedDateTime/ModifiedBy/ModifiedDateTime fields on multiple tables as part of a D365 Finance & Operations implementation project.
Only there are a LOT of tables for which they want those fields enabled (like about 400+ tables probably)

I'm in the process of challenging why this needs to happen for so many tables, and what the added value would be... (user accountability, audits,... etc... I guess)
But for the moment it looks like I will be asked to proceed with this change no matter what.
 
So normally I would to do this by creating table extensions  in Visual Studio for each of those tables and changing the appropriate properties, checking everything into DevOps and release to all environments through build/release pipelines.
But given the number of tables I was hoping to find a more time efficient way of achieving this.

In AX2012 you could do this by looping over a list of table names and using the TreeNode.AOTsetProperty() and TreeNode.AOTsave() methods.
I suppose technically that could still work in a D365F&O development environment (although those methods are marked as /obsolete/ now so it seems), but :
  • it's a bad idea
  • I suppose you would be overlayering instead of creating a table extension in this way ?
  • AND I would still have to find a way to get the changes in version control since I want to release these changes to the different environments (ACC, PROD) in a controlled way through DevOps
 
Does anyone have experience with something similar ?
Any suggestions on how to approach this ?
 
Thanks !
 
  • gverstrepen Profile Picture
    gverstrepen 66 on at
    Enabling createdby fields on D365 tables
    Hi Martin,
     
    That seems like a good way to go about it.
    I will try you suggestion, thanks !
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,885 Super User 2024 Season 2 on at
    Enabling createdby fields on D365 tables
    Hi Gverstrepen,
     
    Apart from preparing the extensions easily, I would suggest asking them about the purpose as it will affect the database growth and potentially have a performance impact. For sure, do proper load testing to check for any performance impact before taking it into production. In case this is about database logging, why aren't they then considering using the database log? A modified by field does not tell what got changed and it does not store details if the record was changed multiple times by different persons.
  • Deepak Agarwal Profile Picture
    Deepak Agarwal 8,564 on at
    Enabling createdby fields on D365 tables
    You can also think about what all table are main table and what are all related tables. I mean table which doest use to create record into them directly or updated from other tables. If you can assess this, may be yu can find lesser table needs to have these fields enabled. 
  • Anton Venter Profile Picture
    Anton Venter 19,459 Super User 2024 Season 2 on at
    Enabling createdby fields on D365 tables
    I agree with Martins suggestion, this is what I would do in this case. With a script or console app just create the XML files for the tables where you want this enabled. Just to be clear, this is creating extensions for the tables and not overlayering them.
  • Martin Dráb Profile Picture
    Martin Dráb 230,569 Most Valuable Professional on at
    Enabling createdby fields on D365 tables
    There is a new metadata API you could utilize, but I would probably forget F&O tools in this case and did it purely on XML level.
     
    Assuming that the extensions don't already exist, you'll generate XML files that are all the same, except of the file name and table name. So you can, for example, create a single XML file with a placeholder instead of a table name, then iterate the list of tables in Powershell, copy the template file for each of them, replace the placeholder with the table name and set the file name. In VS, you'll simply add detected files to source control.
     
    Regaridng existing extensions which you need to modify instead of just generate from a template, I would first check how many they're. If just a few, you can do it manually. If more, I would again use Powershell, because it's pretty good in working with XML.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,885 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans