+ 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 
Hi Navin,

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.
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

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 - 

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

Santosh Chitalkar