Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

How to set change log entries user in Dynamics Nav 2016

Posted on by Microsoft Employee

I've written some code to query the ODATA endpoint in Dynamics Nav 2016. I did this by creating an ODATA connected service. I wrote the following code to add a record:

var navision = new Navision(
    new Uri("http://navision:7048/navision/OData/Company('Company1')"))
{
    Credentials = new NetworkCredential("MyUser@example.com", "password")
};
navision.AddToFoo(new Foo() { Name = "Bar" });
navision.SaveChangesAsync();

I have enabled 'Change Log Entries' for the Foo table. However, when the above code executes, the user displayed in the change log entries is MyUser@example.com. Is it possible to set this user myself explicitly?

*This post is locked for comments

  • Suggested answer
    AJAnsari Profile Picture
    AJAnsari 5,754 on at
    RE: How to set change log entries user in Dynamics Nav 2016

    Hi Muhammad,

    No, not without changing the way the Change Log functionality works in NAV. The user account being used to write the record will be the one recorded in the system.

    You can either change your code so that you use a different set of credentials to insert different records (so that your desired user is recorded in the Change Log Entries). Or, create a new field in the Foo table to record a User ID, and this would be explicitly set by you using your code.

    I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans