Skip to main content
Answer

How to select without merging with Cache

  • November 21, 2022
  • 2 replies
  • 235 views

aaghaei
Captain II
Forum|alt.badge.img+10

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

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

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • November 21, 2022

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


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • November 23, 2022

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