Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Enabling createdby fie...
Finance forum
Unanswered

Enabling createdby fields on D365 tables

Posted on by 59
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 59 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... 287,914 Super User 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 132 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 9,472 Super User 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 225,549 Super User 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans