Blog
Blog

How to Display SystemCreatedBy and SystemModifiedBy Names on Pages and Reports in Microsoft Dynamics 365 Business Central

Posted on 11-Jul-2024 by Anil Verma

Hi, Readers.

Today I will demonstrate how to display name of the SystemCreatedBy and SystemModifiedBy on pages and reports in Business Central.

SystemCreatedBy and SystemModifiedBy field appear in every record as system fields.

SystemCreatedBy and SystemCreatedBy fields

 

Fields are populated as follows:

  • When a new record is created, before calling Insert, the audit fields are given blank GUIDs and blank dates as values.
  • When a record is first inserted, the fields are populated with actual values.

      The $systemCreatedBy and $systemModifiedBy fields are given the same value. So are the $systemCreatedAt and              $systemModifiedAt fields.

      The $systemCreatedBy and $systemCreatedAt fields won't change after this point.

  • When a record is updated, the $systemModifiedBy and $systemModifiedAt fields are changed.

For more information go through the link >>  https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-table-system-fields

Let's begin with an example:

First, we start with the process of displaying SystemCreatedBy and SystemModifiedBy Name on a page.

1)  Here is the Sales Order List page, in which Created By Name is displayed.

Sales Order List page Created By Name is displayed

 

2) Create a procedure GetNameFromSystemID.

AL procedure GetNameFromSystemID to retrieve user name from System ID

 

3) Use the GetNameFromSystemID procedure to display the SystemCreatedBy and SystemModifiedBy Name.

Displaying SystemCreatedBy and SystemModifiedBy names on Business Central page

 

Now, we start with the process of displaying SystemCreatedBy & SystemModifiedBy Name in Report.

1) Extend “Purchase – Credit Memo” report  and create a procedure GetNameFromSystemID

and invoke the procedure in the column

Report extension adding CreatedByName and ModifiedByName columns

 

2) Add columns CratedByName and ModifiedByName in layout.

Adding Created By and Modified By fields in report layout

 

3) We can see Created By and Modified By on report.

Purchase Credit Memo report showing Created By and Modified By names

 

Hope this will help.

Thanks for reading.

 


Post a Comment

Your email address will not be published. Required fields are marked (*)

Captcha
can't read? refresh

WhatsApp Now