You need to sign in to do that
Don't have an account?
yogendra Aragula 8
batch apex sosl
Hi All,
I am looking for a batch apex where i can add some string to the end of the email ID to make it inactive. ex: abc_123@gmai.com+007
some vaule at the end of the email ID. I have a free text where users enters multiple email addresses in this ( Format: salesforce@yahoo.com;sdfc@hotmail.com;developer_sdfc@aol.com). Now i have a batch apex which adds a dummy string at the end of the value in the that field. However i want to add a dummy string after every .com. So how should i find that .com from that field and add some sting to it using batchapex.
Thank you
I am looking for a batch apex where i can add some string to the end of the email ID to make it inactive. ex: abc_123@gmai.com+007
some vaule at the end of the email ID. I have a free text where users enters multiple email addresses in this ( Format: salesforce@yahoo.com;sdfc@hotmail.com;developer_sdfc@aol.com). Now i have a batch apex which adds a dummy string at the end of the value in the that field. However i want to add a dummy string after every .com. So how should i find that .com from that field and add some sting to it using batchapex.
Thank you
Hope that helps
All Answers
Check out this stackexchange thread. http://salesforce.stackexchange.com/questions/53312/sosl-query-in-batch-apex
Hope that helps
global Database.QueryLocator start(Database.BatchableContext BC) {
String query = 'SELECT Id,emailID__c FROM Testemail__c';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, list<Testemail__c> reference)
{
List<Testemail__c> asdf = new List<Testemail__c>();
for(Testemail__c abc : reference)
{
abc.emailID__c = abc.emailID__c + 'hi';
asdf.add(abc);
}
if(!asdf.isEmpty()){
Update asdf;
}
}
global void finish(Database.BatchableContext BC) {
}
}
This is my code
global Database.QueryLocator start(Database.BatchableContext BC) {
String query = 'SELECT Id,emailID__c FROM Testemail__c';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, list<Testemail__c> reference)
{
List<Testemail__c> asdf = new List<Testemail__c>();
for(Testemail__c abc : reference)
{
abc.emailID__c = abc.emailID__c + 'hi';
asdf.add(abc);
}
if(!asdf.isEmpty()){
Update asdf;
}
}
global void finish(Database.BatchableContext BC) {
}
}
This is my code where i want to add some thing to every thing which ends with .com in that field. How to achive it
Hope that helps
But can you tell me if i can use two parameter in slipt method. I Also wanted to split it with ( , ) and ( . ) these two values.