In short: how can I send an email using Siebel's Comm Outbound Email buscomp, when the email body is longer than 40.960 characters? I can use the Outbound Communications Manager BS instead (or another one), but I need the activity record to be created too.
In Siebel 7.8 you can send emails in a few different ways:
Pressing F9 opens the
Send Communications Applet, where the Send button invokes the underlying BCComm Outbound Email→EmailSendmethod: the email is sent and a new activity record is created (S_EVT_ACTandS_EVT_MAILtables). There is no length limit for the email body.From server script, you can use the
Outbound Communications Managerservice methodSendMessage. It doesn't have length limitations either, but it doesn't create any record in Siebel BCs, it just sends the message without leaving any trace.
var psOut:PropertySet = TheApplication().NewPropertySet();
var psIn:PropertySet = TheApplication().NewPropertySet();
psIn.SetProperty("ProcessMode", "Remote");
psIn.SetProperty("Charset", "iso-8859-1");
psIn.SetProperty("CommProfile", from);
psIn.SetProperty("MsgToList", to);
psIn.SetProperty("MsgSubject", subject);
psIn.SetProperty("MsgHTMLBody", body);
var bs:Service = TheApplication().GetService("Outbound Communications Manager");
bs.InvokeMethod("SendMessage", psIn, psOut);
- Or you can replicate the F9 behaviour by creating the BC record yourself and invoking the (undocumented?)
EmailSendmethod. The problem is that you can't set aDisplay Email Bodyvalue longer than 40.960 characters, otherwise you get aSBL-DAT-00235error.
var bo:BusObject = TheApplication().GetBusObject("Service Request");
var bc:BusComp = bo.GetBusComp("Comm Outbound Email");
bc.NewRecord(NewAfter);
bc.SetFieldValue("Email Format", "HTML/Plain Text");
bc.SetFieldValue("Email Charset", "iso-8859-1");
bc.SetFieldValue("Email Sender Address", from);
bc.SetFieldValue("Email Sender Name", from);
bc.SetFieldValue("Email To Line", to);
bc.SetFieldValue("Description", subject);
bc.SetFieldValue("Display Email Body", body); // will fail if body.length > 40960
bc.WriteRecord();
bc.InvokeMethod("EmailSend");
Why am I restricted to 40.960 characters (and where did that number come from?) in the Display Email Body, while the F9 applet doesn't have that limitation? I know that field is special; for starters, Siebel 7.8 doesn't support database columns above 16.383 characters, yet this field max length is 1.024.000 (not 40.960...). For that, the field user property Text Length Override is defined (without value). Also, it isn't mapped to any column: it's a calculated field, but without calculated expression; I guess the BC's CSSBCOutMail class manages it. But still, it should be the same whether I'm using it from scripting or from an applet. Why isn't it, should I change anything anywhere to enable it?
My requeriment is to send long emails from a server script, but I need the activity record to be created too. Is there any hidden parameter that I can set when calling Outbound Communications Manager → SendMessage, in order to create the activity record? Or any way to avoid the error if I do bc.SetFieldValue("Display Email Body", aVeryLongEmailBody);?