You need to sign in to do that
Don't have an account?

find the particular words in sentence using soql
Hi All,
im trying to find the Offencive words in the sentence ,How can i write the Query for that.please helap me.
Thanks In Advance
G.kumar
im trying to find the Offencive words in the sentence ,How can i write the Query for that.please helap me.
Thanks In Advance
G.kumar
Try the below code,
All Answers
trigger ideaOffensive on IdeaComment (Before Insert,Before Update) {
for(IdeaComment a:Trigger.new)
{
if (a.CommentBody=='idiot')
{
a.CommentBody.addError('Senence having Offencive word'); // prevent update
}
}
}
Try the below code,
Use a.CommentBody.containsIgnoreCase('idiot') instead of a.CommentBody.contains('idiot') in line number 6.