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
bs881026bs881026 

Why cant we have SOQL in a trigger?

Hi,
Could anyone please explain to me, as to why cannot we have a SOQL in a trigger.

Thanks
Best Answer chosen by bs881026
ManojjenaManojjena
Hi Bs881026,

It was a issue before that we can not have SOSL inside trigger ,However you can write SOSL inside trigger now .This is implemented in Spring 11 .So you can write SOSL inside trigger .

Check below link ,samem query was before .
https://developer.salesforce.com/forums?id=906F00000008yZiIAI

Let me know if it  helps !!
Thanks 
Manoj
 

All Answers

bs881026bs881026
Hey sorry, I meant SOSL and not SOQL.

Apology
ManojjenaManojjena
Hi Bs881026,

It was a issue before that we can not have SOSL inside trigger ,However you can write SOSL inside trigger now .This is implemented in Spring 11 .So you can write SOSL inside trigger .

Check below link ,samem query was before .
https://developer.salesforce.com/forums?id=906F00000008yZiIAI

Let me know if it  helps !!
Thanks 
Manoj
 
This was selected as the best answer
bs881026bs881026
Thank you so much @ Manoj and Sachin.