web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

How to create a utility class for insert record into log table

(0) ShareShare
ReportReport
Posted on by 382
Hi,
 
I want to create a log table that will keep inserting the timestamp whenever my custom class being called. I have created the log table, but now I'm wondering how to create a utility class that will handle this inserting time stamp.
For example: I have class A, B, C, and D. And in one of their method of class A/B/C/D, I want to call my /utility class/ that will insert the time it is called, what is the class name, what is the method name, and probably when call those method in Class A/B/C/D, they have parameter, I want to record that parameter as well.
 
Is there any example of such process ? a simple one I guess, because if too complex and includes many classes will be too excessive to create.
 
Thanks,
  • Verified answer
    Layan Jwei Profile Picture
    4,102 Moderator on at
    How to create a utility class for insert record into log table
    Hi Ken,
     
    You just create a class and add a static method that accepts className, methodName etc..
    And inside it, you fill the log table with those values then insert into it.
     
    And inside class A,B,C and D you can call this static method and pass those values.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future. You can do this by ticking the box "Does this answer your question"

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Supply chain | Supply Chain Management, Commerce

Featured topics

Product updates

Dynamics 365 release plans