• CMcCaul
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 10
    Replies
I am Java/Apex rookie and I am trying to strip cr/lf characters from a string using the ReplaceAll method.  c.ReplaceAll('\r\n','') doesn't work I guess because '\r\n' isn't a regExp.  I'm sure there's a simple solution but I haven't found it yet.  Can anyone offer some help?
 
Thanks.


Message Edited by CMcCaul on 09-17-2008 11:45 AM
  • September 17, 2008
  • Like
  • 0
Is any one else having a problem sending mail to their Salesforce email services address?  I have an implementation of an email to case apex class that has been working for several weeks, then starting Tuesday at about 3:20 CDT I started receiving the following errors in emails sent to my salesforce email services address:
Tue 2008-06-03 16:27:02: --> STARTTLS
Tue 2008-06-03 16:27:02: <-- 220 continue
Tue 2008-06-03 16:27:04: SSL negotation failed, error code 0x80090308
 
Prior to the failure, the SSL negotiation worked fine:
Tue 2008-06-03 15:19:56: --> STARTTLS
Tue 2008-06-03 15:19:57: <-- 220 continue
Tue 2008-06-03 15:19:57: SSL negotiation successful (TLS 1.0, 1024 bit key exchange, 128 bit RC4 encryption)
 
I have logged a case with Salesforce but haven't heard anything.  All other SSL email is being delivered without error, only those routed to my Salesforce address are failing.  There have been no changes to our mail server.  Any ideas?
 
Thanks,
Chris
I have the following code in my email to case class:
 
global class EmailToCase implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult
 handleInboundEmail(Messaging.inboundEmail email,
 Messaging.InboundEnvelope env){
// Create an inboundEmailResult object for returning the result of the Force.com Email Service
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
 
system.debug('\n\nTo: ' + email.toaddresses[0] + '\nFrom: ' + email.fromaddress + '\nSubject: ' + email.subject + '\nBody: ' + email.plainTextBody + '\n');
 
// remove confidentiality notices from email body
if (email.plainTextBody.contains('CONFIDENTIALITY NOTICE:')) {
    i = email.plainTextBody.indexOf('CONFIDENTIALITY NOTICE:');
    email.plainTextBody = email.plainTextBody.substring(0,i-1);
}
 
and this afternoon I have started to get this error in my debug log:
Subject: xxxxxxxx
Body: null

System.NullPointerException: Attempt to de-reference a null object
Class.EmailToCase.handleInboundEmail: line 22, column 5
 
Line 22, column 5 is trying to reference email.plainTextBody for the first time (.contains).  This has been working for a few weeks.  Has something changed at Salesforce with the inbound email, or do I need to code for some e-mails to actually have a null email.plainTextBody?  The e-mails I received from our mail server do in fact have a body with normal text and a confidentiality notice.  Any ideas?
 
Thanks
I am trying to implement my own email-to-case class and I have the following code, which is working in my sandbox, to create an EmailMessage on a case using email services:
 
EmailMessage[] newEmail = new EmailMessage[0];
 
newEmail.add(new EmailMessage(FromAddress = email.fromAddress,
FromName = email.fromName,
ToAddress = email.toAddresses[0],
Subject = email.subject,
TextBody = email.plainTextBody,
HtmlBody = email.htmlBody,
ParentId = newCase[0].Id, 
ActivityId = newTask[0].Id));   // (newCase and newTask are the newly created case and task from earlier code)
 
insert newEmail;
 
I have several questions.  Is it possible to set the email message status to "New"?  If I attempt to add "Status = 'New'" in the .add() method I get an error: Message: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: New: [Status] null.  If I don't attempt to set the status, it defaults to "Sent".
 
Also, does anyone have any sample code to share that adds headers and attachments from an inbound email to an Email Message object?  I'm struggling with that one.
 
Another minor issue that is bugging me is that in the Email Section of the Case page in my sandbox, the column labelled "Email Address" shows the 'to address' and my production version using the the standard SFDC email to case application will have the 'from address' (contact's address) displayed.  Does anyone know what field in the Email Message object this data comes from?
 
Thanks for the help!
I have a case trigger that closes all open tasks when a case is closed that is working in my sandbox:
trigger CaseCloseTrigger on Case (after update) {
Case[] cse = Trigger.new;

// Get case id's for closed cases
Set<ID> cseIds = new Set<ID>();
for (Case c:cse)
  if (c.isClosed)
  cseIds.add(c.Id);

// Get tasks on cases being closed, update and close if still open
  for (Task t : [select isclosed, status from task where whatid in :cseIds for update])
  if (!t.isclosed){
    t.description = 'Case closed';
    t.status = 'Completed';
    update t;
  }
}

 I am trying to write a test method to in order to deploy the trigger (I'm using Eclipse).
 
public class caseTestTriggerMethod {
  static testMethod void myTest(){

  Account acc = new account(name = 'TestCoverage');
  insert acc;
  Contact con = new contact(accountId = acc.id, lastname='Coverage', firstname='Test');
  insert con;
  Case cseA = new case(accountId = acc.id, contactId = con.id, status = 'New', type = 'Help Request', origin = 'Email', subject = 'Test Coverage 1');
  insert cseA;
  Case cseB = new case(accountId = acc.id, contactId = con.id, status = 'Closed', type = 'Help Request', origin = 'Email', subject = 'Test Coverage 2');
  insert cseB;
  Task tskA_1 = new task(ownerId = '00530000000f6Qn', whatId = cseA.id, whoId = con.id, subject = 'Task A.1', status = 'Not Started', priority = 'Normal', reminderdatetime = null);
  insert tskA_1;
  Task tskA_2 = new task(ownerId = '00530000000f6Qn', whatId = cseA.id, whoId = con.id, subject = 'Task A.2', status = 'Completed', priority = 'Normal', reminderdatetime = null);
  insert tskA_2;
  Task tskB_1 = new task(ownerId = '00530000000f6Qn', whatId = cseB.id, whoId = con.id, subject = 'Task B.1', status = 'Not Started', priority = 'Normal', reminderdatetime = null);
  insert tskB_1;
  Task tskB_2 = new task(ownerId = '00530000000f6Qn', whatId = cseB.id, whoId = con.id, subject = 'Task B.2', status = 'Completed', priority = 'Normal', reminderdatetime = null);
  insert tskB_2;
 
  cseA.status = 'Closed';
  update cseA;

  System.assertEquals(cseA.status,'Closed');
  System.assert(cseA.isClosed);
 
  System.assertEquals(tskA_1.status,'Completed');
  System.assertEquals(tskA_2.status,'Completed');
  System.assertEquals(tskB_1.status,'Not Started');
  System.assertEquals(tskB_2.status,'Completed');
  System.assertEquals(tskA_1.description,'');
  System.assertEquals(tskA_2.description,'Case Closed');
  System.assertEquals(tskB_1.description,'');
  System.assertEquals(tskB_2.description,'');
  }
}

The cseA.status assertion is true, status is closed, but the cseA.isClosed fails and my task is not closed nor status changed to completed.  It's working fine in the sandbox, so I'm guessing that just changing the case status to 'Closed' is not enough to actually close the case.  Is there some method I need to call to get the case closed?
 
Thanks for any help!

Is any one else having a problem sending mail to their Salesforce email services address?  I have an implementation of an email to case apex class that has been working for several weeks, then starting Tuesday at about 3:20 CDT I started receiving the following errors in emails sent to my salesforce email services address:
Tue 2008-06-03 16:27:02: --> STARTTLS
Tue 2008-06-03 16:27:02: <-- 220 continue
Tue 2008-06-03 16:27:04: SSL negotation failed, error code 0x80090308
 
Prior to the failure, the SSL negotiation worked fine:
Tue 2008-06-03 15:19:56: --> STARTTLS
Tue 2008-06-03 15:19:57: <-- 220 continue
Tue 2008-06-03 15:19:57: SSL negotiation successful (TLS 1.0, 1024 bit key exchange, 128 bit RC4 encryption)
 
I have logged a case with Salesforce but haven't heard anything.  All other SSL email is being delivered without error, only those routed to my Salesforce address are failing.  There have been no changes to our mail server.  Any ideas?
 
Thanks,
Chris
I have the following code in my email to case class:
 
global class EmailToCase implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult
 handleInboundEmail(Messaging.inboundEmail email,
 Messaging.InboundEnvelope env){
// Create an inboundEmailResult object for returning the result of the Force.com Email Service
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
 
system.debug('\n\nTo: ' + email.toaddresses[0] + '\nFrom: ' + email.fromaddress + '\nSubject: ' + email.subject + '\nBody: ' + email.plainTextBody + '\n');
 
// remove confidentiality notices from email body
if (email.plainTextBody.contains('CONFIDENTIALITY NOTICE:')) {
    i = email.plainTextBody.indexOf('CONFIDENTIALITY NOTICE:');
    email.plainTextBody = email.plainTextBody.substring(0,i-1);
}
 
and this afternoon I have started to get this error in my debug log:
Subject: xxxxxxxx
Body: null

System.NullPointerException: Attempt to de-reference a null object
Class.EmailToCase.handleInboundEmail: line 22, column 5
 
Line 22, column 5 is trying to reference email.plainTextBody for the first time (.contains).  This has been working for a few weeks.  Has something changed at Salesforce with the inbound email, or do I need to code for some e-mails to actually have a null email.plainTextBody?  The e-mails I received from our mail server do in fact have a body with normal text and a confidentiality notice.  Any ideas?
 
Thanks
I am trying to implement my own email-to-case class and I have the following code, which is working in my sandbox, to create an EmailMessage on a case using email services:
 
EmailMessage[] newEmail = new EmailMessage[0];
 
newEmail.add(new EmailMessage(FromAddress = email.fromAddress,
FromName = email.fromName,
ToAddress = email.toAddresses[0],
Subject = email.subject,
TextBody = email.plainTextBody,
HtmlBody = email.htmlBody,
ParentId = newCase[0].Id, 
ActivityId = newTask[0].Id));   // (newCase and newTask are the newly created case and task from earlier code)
 
insert newEmail;
 
I have several questions.  Is it possible to set the email message status to "New"?  If I attempt to add "Status = 'New'" in the .add() method I get an error: Message: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: New: [Status] null.  If I don't attempt to set the status, it defaults to "Sent".
 
Also, does anyone have any sample code to share that adds headers and attachments from an inbound email to an Email Message object?  I'm struggling with that one.
 
Another minor issue that is bugging me is that in the Email Section of the Case page in my sandbox, the column labelled "Email Address" shows the 'to address' and my production version using the the standard SFDC email to case application will have the 'from address' (contact's address) displayed.  Does anyone know what field in the Email Message object this data comes from?
 
Thanks for the help!
ok, here's my class (work in progress)

Code:
//version 1.1
global class productEmailCreateCase implements Messaging.InboundEmailHandler {

global Messaging.InboundEmailResult
handleInboundEmail(Messaging.inboundEmail email,
Messaging.InboundEnvelope env){

// Create an inboundEmailResult object for returning
// the result of the Force.com Email Service
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();

//define your debugging email
string debugEmail = 'youremail@domain.com';

// get contents of email
string subject = email.subject;
string myPlainText = email.plainTextBody;
string emailtype = 'new';
string fromname = email.fromname;
string fromemail = email.fromaddress;
string[] toemail = email.toaddresses;
string product = '';

//print debug info
system.debug('\n\nTo: ' + toemail + '\n' + 'From: ' + fromemail + '\nSubject\n' + subject + '\nBody\n' + myPlainText);

//set the product based on the incoming email
if (toemail != null){
for (string i : toemail){
if (i.contains('logmeinfree')){
product = 'LogMeIn Free';
}else if (i.contains('logmeinpro')){
product = 'LogMeIn Pro';
}else if (i.contains('logmeinitreach')){
product = 'LogMeIn IT Reach';
}else if (i.contains('logmeinrescue')){
product = 'LogMeIn Rescue';
}else if (i.contains('logmeinbackup')){
product = 'LogMeIn Backup';
}else if (i.contains('logmeinhamachi')){
product = 'LogMeIn Hamachi';
}else if (i.contains('remotelyanywhere')){
product = 'RemotelyAnywhere';
}else if (i.contains('networkconsole')){
product = 'Network Console';
}else if (i.contains('logmeinignition')){
product = 'LogMeIn Ignition';
}
}
}

// First, instantiate a new Pattern object "MyPattern"
Pattern MyPattern = Pattern.compile('.*—[:]{3}[a-z0-9A-Z]{15}[:]{3}.*–');

// Then instantiate a new Matcher object "MyMatcher"
Matcher MyMatcher = MyPattern.matcher(myPlainText);

//status of the matcher
boolean reply = MyMatcher.find();
system.debug('Reply: ' + reply);

//regexp for finding caseid \[:[a-zA-Z0-9]{18}:]
//boolean reply = pattern.matches(':::[a-zA-Z0-9]{18}:::', myPlainText);

//determine if this is a new case or a reply to an existing one
if(reply == true){
emailtype = 'reply';
}

if(emailtype == 'new'){
// new Case object to be created
Case[] newCase = new Case[0];

// Try to lookup any contacts based on the email from address
// If there is more than 1 contact with the same email address
// an exception will be thrown and the catch statement will be called
try {
// Add a new Case to the contact record we just found above
newCase.add(new Case(Description = myPlainText,
Subject = subject,
Origin = 'Email',
SuppliedEmail = email.fromAddress,
Product__c = product,
SuppliedName = email.fromName));

// Insert the new Case and it will be created and appended to the contact record
insert newCase;
System.debug('New Case Object: ' + newCase );
}
// If there is an exception with the query looking up
// the contact this QueryException will be called.
// and the exception will be written to the Apex Debug logs

catch (Exception e) {
System.debug('\n\nError:: ' + e + '\n\n');
string body = 'Message: ' + e.getMessage() + '\n' + e.getCause() + '\n\n' + email.subject + '\n' + fromemail + '\n' + fromname + '\n' + toemail;
sendDebugEmail(body, 'reply');
}
}else if (emailtype == 'reply') { //reply handling
// new Case object to be created
Task[] newTask = new Task[0];
//get the WhatId
string match = MyMatcher.group(0);
system.debug('Match String: ' + match);
string caseId = match.replaceall(':','').trim();
system.debug('Case ID: ' + caseId);

Case[] getCase = new Case[0];
getCase = [select casenumber, id from case where id = :caseId limit 1];


// Try to lookup any contacts based on the email from address
// If there is more than 1 contact with the same email address
// an exception will be thrown and the catch statement will be called
try {
// Add a new Case to the contact record we just found above
newTask.add(new Task(Description = myPlainText,
Subject = subject,
Status = 'Completed',
WhatId = caseId));

// Insert the new Case and it will be created and appended to the contact record
insert newTask;
getCase[0].Status = 'Reply from Customer';
update getCase[0];
System.debug('New Case Object: ' + newTask );
}
// If there is an exception with the query looking up
// the contact this QueryException will be called.
// and the exception will be written to the Apex Debug logs

catch (Exception e) {
System.debug('\n\nError:: ' + e + '\n\n');

//set up and send debug email
string body = 'Message: ' + e.getMessage() + '\n' + e.getCause() + '\n\n' + email.subject + '\n' + fromemail + '\n' + fromname + '\n' + toemail + '\nCase ID: ' + caseid;
sendDebugEmail(body, 'reply');
}

// Set the result to true, no need to send an email back to the user
// with an error message
}
result.success = true;

// Return the result for the Force.com Email Service
return result;
}

static testMethod void testCases1() {

// Create a new email and envelope object
Messaging.InboundEmail email = new Messaging.InboundEmail();
Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();

email.plainTextBody = 'Here is my plainText body of the email';
email.fromAddress =debugEmail;
email.subject = 'My test subject';

productEmailCreateCase caseObj = new productEmailCreateCase();
caseObj.handleInboundEmail(email, env);

// Create a new email and envelope object
Messaging.InboundEmail emailReply = new Messaging.InboundEmail();
Messaging.InboundEnvelope envReply = new Messaging.InboundEnvelope();

// Create the plainTextBody and fromAddres for the test
emailReply.plainTextBody = 'Here is my plainText body of the email';
emailReply.fromAddress = debugEmail;
emailReply.Subject = 'Re: LogMeIn Pro Case:00001030 - testing reply';

productEmailCreateCase caseReplyObj = new productEmailCreateCase();
caseReplyObj.handleInboundEmail(emailReply, envReply);

}
static testMethod void testCases2() {

// Create a new email and envelope object
Messaging.InboundEmail email = new Messaging.InboundEmail();
Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();

// Create the plainTextBody and fromAddres for the test
email.plainTextBody = 'Here is my plainText body of the email';
email.fromAddress ='some@email.com';
email.subject = 'My test subject';

productEmailCreateCase caseObj = new productEmailCreateCase();
caseObj.handleInboundEmail(email, env);

// Create a new email and envelope object
Messaging.InboundEmail emailReply = new Messaging.InboundEmail();
Messaging.InboundEnvelope envReply = new Messaging.InboundEnvelope();

// Create the plainTextBody and fromAddress for the test
emailReply.plainTextBody = 'Here is my plainText body of the email';
emailReply.fromAddress ='some@email.com';
emailReply.Subject = 'Re: LogMeIn Pro Case:00001030 - testing reply';

productEmailCreateCase caseReplyObj = new productEmailCreateCase();
caseReplyObj.handleInboundEmail(emailReply, envReply);
}

public void sendDebugEmail(string emailbody, string emailtype){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {'some@email.com'};
mail.setToAddresses(toAddresses);
mail.setSenderDisplayName('Salesforce Error Handling');
mail.setSubject('Error handling inbound email as a ' + emailtype);
mail.setPlainTextBody(emailbody);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}

static testMethod void testCases3() {

// Create a new email and envelope object
Messaging.InboundEmail email = new Messaging.InboundEmail();
Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();

// Create the plainTextBody and fromAddres for the test
string[] to = new List<string>();
to.add('logmeinfree@salesforce.com');
to.add('logmeinpro@salesforce.com');
to.add('logmeinitreach@salesforce.com');
to.add('logmeinrescue@salesforce.com');
to.add('logmeinbackup@salesforce.com');
to.add('logmeinhamachi@salesforce.com');
to.add('logmeinignition@salesforce.com');
to.add('remotelyanywhere@salesforce.com');
to.add('networkconsole@salesforce.com');
email.plainTextBody = 'This is my test body.';
email.fromAddress ='some@email.com';
email.subject = 'My test subject';
email.toaddresses = to;

productEmailCreateCase caseObj = new productEmailCreateCase();
caseObj.handleInboundEmail(email, env);

// Create a new email and envelope object
Messaging.InboundEmail emailReply = new Messaging.InboundEmail();
Messaging.InboundEnvelope envReply = new Messaging.InboundEnvelope();

// Create the plainTextBody and fromAddres for the test
emailReply.plainTextBody = ':::500700000059WZP:::';
emailReply.fromAddress ='some@email.com';
emailReply.Subject = 'Re: LogMeIn Pro Case:00001030 - testing reply';

productEmailCreateCase caseReplyObj = new productEmailCreateCase();
caseReplyObj.handleInboundEmail(emailReply, envReply);
}

static testMethod void testEmail(){
productEmailCreateCase obj = new productEmailCreateCase();
obj.sendDebugEmail('this is the body', 'new');
}
}

 
you can modify to suit your own needs, as there's 'some' custom stuff particular to our org.  this email class handles both new inbound and reply inbound emails.

a couple notes:
* you need to DELIVER emails to the SF address you associate with the email service.  you cannot just forward them.  this means, you need to be able to have your email server/service deliver to the address directly.  if you don't, you'll lose contact info, which would be mapped to the webname and web email fields.
* contact autocreation is not in this revision, as I use a custom s-control for this now.  i'm open to ideas on what exactly should be done on this front.  we currently create a contact, and map it to an account based on the domain part of the email address.  i'm not interested in coding a solution to handle person accounts.
* you need to modify the 'debugEmail' value to be the one you want errors sent to.  rather than relying on the debug logs of SF, i figured this would be an easier approach.
* code coverage is 90%.  the only code that isn't covered is the catch statement exception handling, as I didn't know how to force an exception at the time I wrote this.
* you need to add the following to the bottom of all your email templates, on a line of its own.
Code:
:::{!case.id}:::

 
i'm open to feedback of course.



Message Edited by paul-lmi on 03-10-2008 09:57 AM
Hi,
 
I have downloaded the Email 2 Case plugin for salesforce and a part of it is working fine. It does create a new case out of the mails that are sent to the test mailbox.
 
However, it creates a new case out of every mail that comes to the test inbox. I want to know if I can achieve the following:
 
1. Create a new case out of a new mail that comes to the mailbox.
<have salesforce auto reply to the customer>
2. When the customer replies back to the auto response or two his earlier mail, I want it to add an email to existing case, and NOT create a new case.
 
I think email 2 case is capable of doing it. I just dont know how to do it. Also is there documentation available for the email 2 case plugin besides the wiki page.
 
Regards,
Tejanshu
I have a case trigger that closes all open tasks when a case is closed that is working in my sandbox:
trigger CaseCloseTrigger on Case (after update) {
Case[] cse = Trigger.new;

// Get case id's for closed cases
Set<ID> cseIds = new Set<ID>();
for (Case c:cse)
  if (c.isClosed)
  cseIds.add(c.Id);

// Get tasks on cases being closed, update and close if still open
  for (Task t : [select isclosed, status from task where whatid in :cseIds for update])
  if (!t.isclosed){
    t.description = 'Case closed';
    t.status = 'Completed';
    update t;
  }
}

 I am trying to write a test method to in order to deploy the trigger (I'm using Eclipse).
 
public class caseTestTriggerMethod {
  static testMethod void myTest(){

  Account acc = new account(name = 'TestCoverage');
  insert acc;
  Contact con = new contact(accountId = acc.id, lastname='Coverage', firstname='Test');
  insert con;
  Case cseA = new case(accountId = acc.id, contactId = con.id, status = 'New', type = 'Help Request', origin = 'Email', subject = 'Test Coverage 1');
  insert cseA;
  Case cseB = new case(accountId = acc.id, contactId = con.id, status = 'Closed', type = 'Help Request', origin = 'Email', subject = 'Test Coverage 2');
  insert cseB;
  Task tskA_1 = new task(ownerId = '00530000000f6Qn', whatId = cseA.id, whoId = con.id, subject = 'Task A.1', status = 'Not Started', priority = 'Normal', reminderdatetime = null);
  insert tskA_1;
  Task tskA_2 = new task(ownerId = '00530000000f6Qn', whatId = cseA.id, whoId = con.id, subject = 'Task A.2', status = 'Completed', priority = 'Normal', reminderdatetime = null);
  insert tskA_2;
  Task tskB_1 = new task(ownerId = '00530000000f6Qn', whatId = cseB.id, whoId = con.id, subject = 'Task B.1', status = 'Not Started', priority = 'Normal', reminderdatetime = null);
  insert tskB_1;
  Task tskB_2 = new task(ownerId = '00530000000f6Qn', whatId = cseB.id, whoId = con.id, subject = 'Task B.2', status = 'Completed', priority = 'Normal', reminderdatetime = null);
  insert tskB_2;
 
  cseA.status = 'Closed';
  update cseA;

  System.assertEquals(cseA.status,'Closed');
  System.assert(cseA.isClosed);
 
  System.assertEquals(tskA_1.status,'Completed');
  System.assertEquals(tskA_2.status,'Completed');
  System.assertEquals(tskB_1.status,'Not Started');
  System.assertEquals(tskB_2.status,'Completed');
  System.assertEquals(tskA_1.description,'');
  System.assertEquals(tskA_2.description,'Case Closed');
  System.assertEquals(tskB_1.description,'');
  System.assertEquals(tskB_2.description,'');
  }
}

The cseA.status assertion is true, status is closed, but the cseA.isClosed fails and my task is not closed nor status changed to completed.  It's working fine in the sandbox, so I'm guessing that just changing the case status to 'Closed' is not enough to actually close the case.  Is there some method I need to call to get the case closed?
 
Thanks for any help!