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
MohanaGopalMohanaGopal 

SOQL

What is the difference between synchronous call and asynchronous call in a soql query.. Which one is best...
werewolfwerewolf
An asynchronous call (I presume you mean using the AJAX toolkit) allows the browser to continue processing Javascript code while it's waiting for the query results to return.  A synchronous call stops all Javascript in its tracks until the query results return.

If you need your code execution to stop, i.e. it can't do anything useful until the query results are in, then use a synchronous call.  Otherwise use an asynchronous call, which makes for a more fluid user experience.