Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. // Find STA No. (in email body)
  2. Opportunity Opp = [SELECT id, STA_No__c Opportunity WHERE Id = :matcher.group(0)];
  3. String staNo = email.plainTextBody;
  4. Pattern staPattern = Pattern.compile('STA[0-9]{4}');
  5. Matcher matcherSta = staPattern.matcher(staNo);
  6. if (matcherSta.find())
  7. Opp.STA_No__c = matcherSta.group(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement