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
Kishan TrambadiyaKishan Trambadiya 

Help on SOSL Query for updating

Not sure where i am doing wrong. Simple one.... I have to search keywords same as previous update keywords

list<Chatter_Monitor_Keywords__c> obj = [SELECT SCK_Upload_Id__c,Chatter_Monitor_Policies_Level__c,Chatter_Monitor_Policy_Keyword__c from Chatter_Monitor_Keywords__c where id=:newSCK_id and CreatedByid=:UserInfo.getUserid()];

if(obj.size()>0)
{
string abc=obj[0].Chatter_Monitor_Policy_Keyword__c;
obj[0].Chatter_Monitor_Policy_Keyword__c=newSCK.Chatter_Monitor_Policy_Keyword__c;

update obj[0];

string s ='%'+ abc + '%';

List<Chatter_Monitor_Policy__c> records = ['Find \'' + Chatter_Monitor_Policy_Keyword__c +'\' IN Chatter_Monitor_Policy__c Fields RETURNING Chatter_Monitor_Policy__c(Chatter_Monitor_Policy_Keyword__c' ;
query+= 'Id,Chatter_Monitor_Policy_Keyword__c WHERE Chatter_Monitor_Policy_Keyword__c=:s)'];

if(records.size()!=null)
{
for(Integer i=0;i<records.size();i++)
{
records[0].Chatter_Monitor_Policy_Keyword__c = s;
update records[0];
}
}

i want to update same keyword as above update.
Chatter_Monitor_Policy__c - Custom Object
Chatter_Monitor_Policy_Keyword__c - field of Chatter_Monitor_Policy__c custom object.