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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Extension not working for SysDataBaseLog table

(0) ShareShare
ReportReport
Posted on by 1,424

Hi there!

I am trying to make an extension of SysDataBaseLog table to change the value of description field. I have implemented the chain of command design pattern for setDescription() method however it is NOT working as expected. Please note I am aware of how to implement COC however in this case it just doesn't work. I am curious to know if system tables are exempted from being extended? Please note even the infolog nor any breakpoint is hitting for this code. Although it is compiling successfully.

Below is the code am using to achieve the requirement:

[ExtensionOf(tableStr(SysDataBaseLog))]
final class SysDataBaseLog_Extension
{
    void setDescription(Common common)
    {
        VendBankAccount vendBankAccount;

        if (common.TableId == vendBankAccount.TableId)
        {
            vendBankAccount = common;
            this.Description = vendBankAccount.VendAccount;
        }

        info(strFmt("Finally in! %", common.TableId));

        next setDescription(common);
    }

}

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi Muhammad,

    Have you debugged your code?

    if condition not met.

    88730.PNG

  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    Values are inserted in this table using SQL trigger, that might be the reason you are not able to set it using this method. Did you check if this method is getting called anywhere  using find references ?

  • Yuji Profile Picture
    4,131 on at

    Hi Sukrut,

    Is there any documentation regarding the SQL trigger record insert? Is it a new feature in D365FO?

    Thanks,

  • Blue Wang Profile Picture
    on at

    Hi Yuji,

    00680.PNG

  • Yuji Profile Picture
    4,131 on at

    So this is controlled by Kernel?

  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    So the way it works is when you enable database log for example vendtable , System (X++ code )automatically creates trigger on the table you are enabling database log. You can check the created trigger in your local dev VM and all operations  are tracked in database log using this.  

  • M Anas Khan Profile Picture
    1,424 on at

    Hi Sukrut,

    Thanks for the insight! Yes I can see the trigger on the VendBankAccount table setting the description field. This means that the code in setDescription() doesn't get executed or may be translated into the SQL trigger and may couldn't be translated likewise when extending through COC.

    Trigger.png

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    That's correct . I saw in the past  some of the code present related to this functionality  doesn't get executed and it might be true for method you are trying to do COC.  

  • M Anas Khan Profile Picture
    1,424 on at

    The method setDescription() is getting called in application.logUpdate() method for my scenario, let me try to extend this class instead.

  • M Anas Khan Profile Picture
    1,424 on at

    Tried to implement the onInserting event handler of setDescription method in SysDataBaseLog. No success. Tried to implement COC for logUpdate method in Application class. No success!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans