You need to sign in to do that
Don't have an account?

S-Control Javascript Error - Send Email functionality
Hi,
We have a old S-control on a custom object that is used to Email the details of the record to the current user's Email id.
This S-control was created long back.
But recently, we have found that the button on clik gives error "faultcode:"Soapenv:Client" faultstring:The content of elements must consist of well-formed character data or markup".
Well I am not able to debug the code, as it was written by someone else.
What do you reckon could be a possible solution?? I am really bad with S-controls but I know Javascript
Please help!
P.S. Creating this functionality using VF is on my mind, but i will try to debug this first!
Could you please post source code of S-control
It will be more easiar to look into it
Thanks,
Bala
This is the small piece i wrote to test..
----------------------------------------------------------------
{!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")};
{!REQUIRESCRIPT("/js/functions.js")};
function layoutResults(sendEmailResult) {
try{
if (sendEmailResult.length > 0) {
if (sendEmailResult[0].getBoolean("success")) {
alert("Email has been sent!");
}
else { alert(sendEmailResult[0].errors);
//alert("Error here");
}
}
else { alert("Didn't get return data");
}
}
catch(err) {
alert('some stupid error');
}
} //function end
var singleRequest = new sforce.SingleEmailMessage();
singleRequest.replyTo = "myemailid@gmail.com";
singleRequest.subject = "Hello Test";
singleRequest.plainTextBody = "nothing in body";
singleRequest.toAddresses = ["myemailid@gmail.com"];
try{
var sendMailRes = sforce.connection.sendEmail([singleRequest], layoutResults);
}
catch(err){
alert("Error here is:"+err);
}
-------------------------------------------------------------
and this is the resulting alert i am receiving:
-------------------------------------------------------------
{fields:null, message:'Invalid to address : function (b) {
var a = this.indexOf(b);
if (a != -1) {
this.splice(a, 1);
}
return this;
}', statusCode:'INVALID_EMAIL_ADDRESS', targetObjectId:null, }
-------------------------------------------------------------
Why do you think I am getting this error?? Moreover, email id given is proper!! Pls help!
ooops,
I had copy paste same code in my Org, It works fine ..... It show me result as Email has been sent
Thanks,
Bala
and did you "recieve" the mail??
Well, In my org now i am getting different errors..
says "the content of elements must consist of well formed character data or markup."
Although.. i am using onlt 2 simple texts lines as subject and body..
Pls help!
I didnt receive any email ....... as I havent put any valid email id over there
but there was no any soap error
Thanks,
Bala
Hey, I was trying a new idea.. pls see still not working......