• siwij remar
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Dear Folks,

I have a queue named "Prepaid" and want to route Email 2 case to a particular Prepaid Queue  when emails  contains "Airtel" in Subject

Wrote a Trigger for Email 2 case queue such that  it triggers when Email subject is AIRTEL(Space Before and After)

Step 1:
Created below Custom Label with   string to match against. As I want to route emails which contains Airtel in Subject to a above Prepaid queue

EmailSubjectAsw = “Airtel”

Step 2:
Created Case Trigger (beforeInsert) and used this code snippet below:
 
trigger PrepaidEmailSubjectAsw on Case (before insert) {

					
					public static void setCaseType(List<Case> records) {
					String searchWords;
					List<String> strings;
					for(Case c : records) {
						searchWords = Label.EmailSubjectAsw;
						strings = searchWords.split(',');
						if (isStringInTarget(strings, c.Subject)) {
							continue; 
						}
							} // end for loop
				} 
				public static Boolean isStringInTarget(List<String> strings, String target) {
					String strRegEx = '(?i)\\b(';
					// case insensitive and exact match only 
					for (String s : strings) {
						strRegEx = strRegEx + s + '|'; // build up a list of strings using | separator 
					}
					strRegEx = strRegEx.removeEnd('|'); // get rid of the last OR
					strRegEx = strRegEx + ')\\b';
					Matcher matcher=Pattern.compile(strRegEx).matcher(target);
					Boolean result= matcher.find();
					return result;
					ID queueId = [SELECT Queue.Id FROM queuesobject WHERE queue.name='Prepaid'];
					Case.OwnerId = queueId;
				}
				}

Getting Error as
 
Line 26 Illegal assignment from List<QueueSobject> to Id
            Line 27 A value cannot be stored to OwnerId in type Case
            Line 26 Unreachable statement


Can some one provide resolution above and  fix the Trigger code 


Thanks In Advance,your help is appreciated

Fiona



 
Hi All,

I have created 2 web-to-lead forms with 2 different site keys for hosting in different domains. The form(with reCaptcha)  hosted in domain 1 is generating the lead in salesforce after submitting the form. 

But, the form hosted in domain 2 is not generating any lead in salesforce even after properly validating all data. If I remove the reCaptcha part from the form and submit, its generating a lead in salesforce. But, with reCaptcha functionality included in the form, its not generating any lead in salesforce. I am not getting any error while submitting the form and I also enabled debug and it seems ok with all the correct inputs that I gave. 

Please Help!!!

Lokesh