# Change Log Entry not updated when a record is inserted/modified via web service

**URL:** <https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241>\
**Category:** Technical Forum\
**Created:** [October 8, 2014, 12:32pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241 "2014-10-08T12:32:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mates](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Mates](https://www.dynamicsuser.net/u/Mates)\
**Post date:** [October 8, 2014, 12:32pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/1 "2014-10-08T12:32:58Z")

</div>

Hi,

we have a WPF application which communicates with NAV 2009 R2 via web service. Meaning we display data from NAV in our WPF app and also insert/modify them from the app.

One of our customers uses Change Log functionality in NAV but when records are inserted/modified from our app then no record in Change Log Entry table is created.

Found following link: [http://msdn.microsoft.com/en-us/library/hh167300(v=nav.70).aspx](http://msdn.microsoft.com/en-us/library/hh167300(v=nav.70).aspx)

We tried to do a modification to make it working similar way as in NAV 2013 but did not help. Any other hint, experience??

Thanks!!

---

<div class="post-metadata">

**Author:** ![archer89](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@archer89](https://www.dynamicsuser.net/u/archer89)\
**Post date:** [October 8, 2014, 9:42pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/2 "2014-10-08T21:42:17Z")

</div>

hi,

do you call insert(true) in c/al code?

best regards

---

<div class="post-metadata">

**Author:** ![Mates](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Mates](https://www.dynamicsuser.net/u/Mates)\
**Post date:** [October 9, 2014, 12:31pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/3 "2014-10-09T12:31:05Z")

</div>

Hi,

we use XML ports to insert data in NAV thus insert(true) is not possible to use ☹

Regards,

Martin

---

<div class="post-metadata">

**Author:** ![archer89](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@archer89](https://www.dynamicsuser.net/u/archer89)\
**Post date:** [October 10, 2014, 3:00am UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/4 "2014-10-10T03:00:12Z")

</div>

hi,

you seem to use xmlport parameters to get classes in .net code. that fine. 🙂

do following: encapsulate the code in the oninsert trigger to a function “CallOnInsert”.

within the webservice method “insert” in your c/al code call that function “CallOnInsert”. so this insert also runs through the whole code needed to create the additional objects.

best regards

---

<div class="post-metadata">

**Author:** ![Mates](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Mates](https://www.dynamicsuser.net/u/Mates)\
**Post date:** [October 10, 2014, 12:45pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/5 "2014-10-10T12:45:52Z")

</div>

Hi,

I think your suggestion can work but since we use quite a lot of xml ports we were thinking if there is some solution which could work more generally.

Anyway thanks for your help!!

Regards,

Martin

---

<div class="post-metadata">

**Author:** ![anfinnur](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@anfinnur](https://www.dynamicsuser.net/u/anfinnur)\
**Post date:** [October 14, 2014, 2:46pm UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/6 "2014-10-14T14:46:55Z")

</div>

If not changed in recent times (cumulative updates), the change-log does only work when data is entered in forms and pages.

It does not work when data is handled in reports, XML-ports or whatever. Tos use VALIDATE and INSERT(TRUE) don’t do it.

You have to handle it yourself via codeunit 1, functions OnGlobalInsert, -Modify,… (before NAV 2013) or functions OnDatabaseInsert, - Modify, … in NAV 2013+.

---

<div class="post-metadata">

**Author:** ![Mates](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Mates](https://www.dynamicsuser.net/u/Mates)\
**Post date:** [October 15, 2014, 8:08am UTC](https://www.dynamicsuser.net/t/change-log-entry-not-updated-when-a-record-is-inserted-modified-via-web-service/55241/7 "2014-10-15T08:08:14Z")

</div>

Not sure if completely understand what you mean.

What we tried to do even in the very begining was to move calling of Change Log functionality in CU1 from OnGlobalInsert to OnDatabaseInsert in 2009 but did not help.
