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
lavanya gottumukkalalavanya gottumukkala 

calling soql query from javascript in a vf page

Hi All,

I need to call soql query from javascript code in vf page.
In that query i need to use id=:UserInfo.getUserId() in the where clause.But it will not support binding variable,then how can i achieve it without using any controller?

Thanks in advance
NagaNaga (Salesforce Developers) 
Hi Lavanya,

Please see the sample code below

User-added imagePlease see the below code for more information

Best Regards
Naga Kiran
Arunkumar RArunkumar R
Hi Lavanya,

Checkout the below link, this will helpful to you..!

https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm