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
naveen kunurunaveen kunuru 

an interview question

y u cant write a sosl in  a trigger
how can u call a diff controller from script 
SantoshChitalkarSantoshChitalkar
Hi Navin,

1) 
SOSL statements evaluate to a list of lists of sObjects, where each list contains the search results for a particular sObject type. The result lists are always returned in the same order as they were specified in the SOSL query. SOSL queries are only supported in Apex classes and anonymous blocks.

2) Use javascript remoting.

Mark this question as solve and choose best answer if this answers your questions.
Regards,
Santosh
naveen kunurunaveen kunuru
hello santosh ,i known that sosl returns list of values from mul sobject ,is that the reason y we cant put it in trigger
sandeep sankhlasandeep sankhla
Hi Naveen,

Please refer below link for more details
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yZiIAI

Thanks,
Sandeep
SantoshChitalkarSantoshChitalkar
Hi Naveen,

The exact answer is, SOSL queries are only supported in Apex classes and anonymous blocks. You cannot use a SOSL query in a trigger.
You can say, Salesforce doesn't allow it so you can't use it. Here is the salesforce link for your reference, check under 'SOSL statement' section - 
http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/langCon_apex_SOQL.htm

if this answers your question then mark this question as solved and choose the best answer.

Regards,
Santosh Chitalkar