AL icon indicating copy to clipboard operation
AL copied to clipboard

The query returns false when reading the next line if a change is made.

Open FSchneiderYav opened this issue 1 month ago • 0 comments

Please include the following with each issue: TrackingID#2511210050001556

1. Describe the bug I have created a simple query to return a contact for the customer. In BC27 the lQuery.Read() returns false after a modify is performed in the loop.

query 50100 Customer
{
    elements
    {
        dataitem(Customer; Customer)
        {
            filter(No_; "No.") { }
            dataitem(Contact; Contact)
            {
                DataItemLink = "No." = Customer."Primary Contact No.";
                column(Company_Name; "Company Name") { }
                column(ContactNo_; "No.") { }
            }
        }
    }
}
lQuery.SetRange(No_, '10000', '40000');
lQuery.Open();
lQuery.Read();
repeat
  lInteger += 10000;
  lCustomer.Get(Format(lInteger));
  lCustomer.Name := lCustomer.Name + ' - Modified';
  lCustomer.Modify();
until not lQuery.Read();

3. Expected behavior My expectation is, that all Customers from 10000 to 40000 have added to there name the Suffix - Modified. In BC26 it is working

4. Actual behavior Only Customer 10000 has the Suffix - Modified

5. Versions:

  • AL Language:
  • Visual Studio Code: 16.2.1869542
  • Business Central: Version: DE Business Central 27.1 (Plattform 27.0.41799.0 + Anwendung 27.1.41698.42551)
  • List of Visual Studio Code extensions that you have installed:
  • Operating System: Windows

FSchneiderYav avatar Nov 25 '25 09:11 FSchneiderYav