In standard Navision if you want to find out who created/modified a document i.e. sales order, purchase order, transfer order… you cannot unless you do have a customization or you have to enable a change log setup <p> </p> <p>In this blog I will discuss how to make the customization to achieve this, but if you want to know how to achieve this using change log setup please refer to the following links</p> ## http://www.archerpoint.com/blog/Posts/setting-change-logs-microsoft-dynamics-nav-2013
Please note if you are using change log to trace for insertion and modification, then don’t include all the fields in your change log setup include only some fields.
## How to
achieve with customization: You need to have development license to
make the below modifications <p>This example is for Sales order but you can do
the same for other documents.</p> <p>Open development environment and from the
Object Designer select table tab on the left hand side and choose table
36 – Sales Header</p> <p>Select Design and
add the following four fields, </p> <p align="left">1.
Created By (Code 50)
</p> <p align="left">2. Created On ( DateTime)
</p> <p align="left">3. Last Modified By (Code 50)
</p> <p align="left">**4. Last Modified On (DateTime)** </p> <p align="left"></p>
The field number’s can be different. Save the change by choosing File –> Save and Then File –> Exit.
Open the table 36 again in design mode, then from Menu choose View –> View C/AL Code or Press F9
As show in the below Figure 1, you need add the custom code in the **OnInsert** Trigger and **OnModifiy** Trigger of the object
Figure 1: Showing Table 36 Sales Header in Design Mode C/AL Code – OnInsert and OnModify Triggers
OnInsert() // SK0001 >> "Created By" := USERID; "Created On":= CURRENTDATETIME; // SK0001 << OnModify() // SK0001 >> "Modified By" := USERID; "Modified On" := CURRENTDATETIME; // SK0001 <<
Save the changes by choosing File –> Save and Then File –> Exit.
Now you can go to the Sales Order Page (42) or Sales List Page and add those fields, if you want to track this in purchase or transfer then you can repeat the same steps as above but for the purchase use **38 – Purchase Header** table and for Transfer Order – **5740 Transfer Header** Table.
With these simple modifications now you can track who created/modified or when they created/modified.
Please leave your comments and suggestions.