PEG_LIST icon indicating copy to clipboard operation
PEG_LIST copied to clipboard

[bug] sfpegList - SOQL Query Failure: Unexpected Token Error

Open tbx-cf opened this issue 8 months ago • 3 comments

Describe the bug When retrieving a list of accounts, we are able to successfully display accounts and load more using the 'Load More' button, even when some account names contain special characters like an apostrophe ('). However, after loading an account with such a special character, clicking the 'Load More' button again results in an error. The error message displayed is:

'Data fetch failed: Paginated SOQL Query failure: unexpected token: '''

This error occurs specifically when attempting to load more accounts after having already loaded an account with a special character in its name.

To Reproduce Steps to reproduce the behavior:

  1. Open the records with account list view.
  2. Scroll through the initial list of accounts displayed.
  3. Click the "Load More" button to fetch additional accounts.
  4. Continue clicking "Load More" and click until you encounter an account with a special character (like an apostrophe) in its name.
  5. Verify that this account with the special character loads and displays correctly.
  6. Click "Load More" again to fetch the next set of accounts.
  7. Observe that an error message appears: "Data fetch failed: Paginated SOQL Query failure: unexpected token: '''"

Expected behavior The presence of special characters in account names should not cause any issues with the paginated query. The system should handle these characters gracefully and continue to load more accounts without errors, regardless of the presence of special characters like apostrophes in previously loaded account names.

Screenshots

Image Image

Desktop (please complete the following information):

  • OS : Windows 11
  • Browser : chrome

tbx-cf avatar Apr 24 '25 09:04 tbx-cf

@tbx-cf Just saw your issue as I was working on repackaging my PEG_APEX repository as unlocked packages. I shall first finalize the same operation on the PEG_LIST repository before addressing your issue.

pegros avatar Jun 18 '25 17:06 pegros

@tbx-cf Just released the new packaging at last. Could you please provide me with more configuration details about your issue? Especially, are you using the Name field as Query Order By property ? ℹ️ Beware that if you do not use an ordering field with non unique values (typically SystemModstamp on an Object with batch or Bulk API updates), the pagination may not work properly.

pegros avatar Sep 25 '25 08:09 pegros

@tbx-cf My apologies for the latency. I am afraid the situation is a little complex to handle. If it works for you, I introduced the support of the standard OFFSET SOQL statement for pagination. Please tell me if it meets your requirements.

pegros avatar Oct 23 '25 14:10 pegros