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
gvgv 

Displaying values in Visual force

Hi,

I am new to Visual force so this question may seem way too obvious. I have a Search page and I would like to write the SOQL to the screen to see how it is constructed. Not sure how to do it.

This is a customer portal page so that user (whom I logged in as) is not available in the debug logs user list.

I just want to write the SOQL after it is constructed.

For ex: I have this soqlQuery = 'Select id,name from products'

the above is a very basic example but how do I write to this to the screen so I can look at how the soql query with all the search conditions and order by conditions is constructed

Thanks
Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Once you have constructed your query, store it in a controller property, e.g.

 

public String soqlStr {get; set;} 

 

...

 

soqlStr=<constructed query>; 

 

 

You can then output this to the page using:

 

{!soqlStr}

 

All Answers

bob_buzzardbob_buzzard

Once you have constructed your query, store it in a controller property, e.g.

 

public String soqlStr {get; set;} 

 

...

 

soqlStr=<constructed query>; 

 

 

You can then output this to the page using:

 

{!soqlStr}

 

This was selected as the best answer
gvgv
Thanks it worked