How to select without merging with Cache

  • 21 November 2022
  • 2 replies

Userlevel 4

Hello everyone,

I need to run a query without the platform merging the DB result with the Cache and showing it to me. I have something very simple like this

bool isResumed = PXSelect<EPApproval,
Where<EPApproval.refNoteID, Equal<Required<EPApproval.refNoteID>>,
And<EPApproval.status, Equal<Required<EPApproval.status>>>>>
.Select(Base, RefNoteID, HCLEPStatuses.CustomPending) != null;

In one of my queries I know for sure it should return false as I do not have the matching criteria in DB but because the query result is merged with Cache “true” is returned. I could clear the Cache before querying but the case is I need the data stored in the Cache by the platform for further processing. Any help will be appreciated. I got around it using “PXDatabase.SelectSingle<EPApproval> …” but I do not believe it is the correct way.


Best answer by Dmitrii Naumov 21 November 2022, 13:00

View original

2 replies

Userlevel 7
Badge +2

There is PXSelectReadonly, which works exactly like a regular select except for merging with cache part.

Userlevel 4

Thank you very much @Dmitrii Naumov. It works exactly as expected.


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2022  Acumatica, Inc. All rights reserved