function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark CrooksyMark Crooksy 

Delay in new records appearing in API queries

Hi,

I seem to be experiencing a delay of around 5-6 minutes between adding a new record and it appearing in the API queries that I'm calling in the AIR app that I'm developing.

If I add a new record, either through the app or through a browser the record is successfully inserted into the database immediately. 

If I then try to find the record using Salesforce in the browser it appears OK. 

If I try to find the record using a search query (within the app) I have to wait around 5-6 minutes before the record can be found.
i.e. I keep performing a query every 30 seconds.
Each time I peform a search query within the app the Salesforce database is successfully queried and results sent back more or less immediately so it's not a connection issue.

Would anyone have any idea what's going on and how to fix this?

Thanks in advance,

Mark
ShashankShashank (Salesforce Developers) 
This could be due to search indexing. When a new record is created, it takes time for it to appear in search results or SOSL query results. This time is for the record to get indexed and only then the record appears in searches. Though the time taken is not fixed, 5-6 minutes is an acceptable duration.
Mark CrooksMark Crooks
OK. Thanks for replying.