# NEXT  - unusual behavior

**URL:** <https://www.dynamicsuser.net/t/next-unusual-behavior/9736>\
**Category:** Developers Forum\
**Created:** [February 22, 2005, 5:04pm UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736 "2005-02-22T17:04:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Student](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Student](https://www.dynamicsuser.net/u/Student)\
**Post date:** [February 22, 2005, 5:04pm UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736/1 "2005-02-22T17:04:26Z")

</div>

Hi, I have 2 recs after applying filters. Find(’-’) shows me the first. Next = 0 immediately after that returns TRUE. The problem is that system steps into the second record, BUT the TRUE value of NEXT = 0 triggers the EXIT function. This particular situation occurs in k22. The problem is not “stable” - if the code is triggered from the other place (caeteris paribus), everything is ok. Has anyone met such a strange behaviour?

---

<div class="post-metadata">

**Author:** ![Jack\_Reynolds](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jack\_Reynolds](https://www.dynamicsuser.net/u/Jack_Reynolds)\
**Post date:** [February 22, 2005, 8:02pm UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736/2 "2005-02-22T20:02:21Z")

</div>

Is this happening in the ApplyItemLedgEntry function in codeunit 22? Is your database SQL? I have just recently seen this happening in this function. I also believe this to be related to SQL but can’t be certain because of the difficulty in reproducing the error; as you indicate the problem is not stable. I’m basing my belief on the fact that I have a SQL database where the problem occurs and if I do a backup/restore of this database into a Navision database the problem does not happen.

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [February 23, 2005, 6:29am UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736/3 "2005-02-23T06:29:23Z")

</div>

What Navision version does this happen in ?

---

<div class="post-metadata">

**Author:** ![Student](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@Student](https://www.dynamicsuser.net/u/Student)\
**Post date:** [February 23, 2005, 11:25am UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736/4 "2005-02-23T11:25:31Z")

</div>

Hi, this is 3 60 SQL Database. The Trigger is really ApplyItemLedgerEntry.

---

<div class="post-metadata">

**Author:** ![robertc](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@robertc](https://www.dynamicsuser.net/u/robertc)\
**Post date:** [February 23, 2005, 3:50pm UTC](https://www.dynamicsuser.net/t/next-unusual-behavior/9736/5 "2005-02-23T15:50:52Z")

</div>

There has been a fix to a problem related to NEXT in one of the later 3.60 hotfixes released approximately 1 year ago. Perhaps obtaining the latest c/side binaries will help you. This fix was in ndbcs.dll, but you’ll also need a new finsql.exe. If you already have these then you are hitting a new problem apparently.
