function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ron HessRon Hess 

email author emailauthor.jsp

I have created a scontrol which grabs some information from objects within the system and then opens the "send an email" dialog using javascript like this

location.replace("/email/author/emailauthor.jsp?" +
    "retURL=%2F" + opp_id +
    "&p3_lkid=" + opp_id +
    "&p2_lkid=" + to_id +
    "&p4=" + cc_line +
    "&p6={!Account_Name} request for connection to "+supplier.Item('Name').Value +
    "&p7=" +body_str
    );

This works, unless body_str is too long ( more than  ~ 1K ), but I know the Select Template feature does write larger strings into this body window, I'm looking for an example or tips on how this is done.

I suspect that the Select Template function (openTemplateSelector(event)) does it's thing then writes the finished body back into opener.document.editPage.p6.innerHTML to populate the body.

Am I on the right track with this ?

I would like to do this same thing to create a larger body than is possible using the "on the url" method

does anyone have tips / tricks / examples handy ?

it appears that i need to wait until the location.replace has finished drawing before making any change to the new location form.

thanks !

fifedogfifedog

Hey Ron,

I think we may both be having a simalar issue... see my thread: http://forums.sforce.com/sforce/board/message?board.id=scontrols&message.id=449

 

Ron HessRon Hess

perhaps simalar, however i've solved my issue, here's hoping that this snipit helps you solve yours

instead of location.replace, i now am using window.open, then set a timer, then populate the body when the timer fires and the new window.document.editPage is ready.  This appears to be working for me:

function send_registration () {

[ blah, blah.... your code here]

editWin = open("/email/author/emailauthor.jsp?" +
    "retURL=%2F" + opp_id +
    "&p3_lkid=" + opp_id +
    "&p2_lkid=" + to_id +
    "&p4=" + cc_line +
    "&p6={!Account_Name} request for connection to "+supplier.Item('Name').Value ,
  '_blank','width=800,height=500,resizable=yes,toolbar=no,status=no,scrollbars=yes');

setTimeout("fill_body()", 1700 ) ; // play with this timeout value

} // end

function fill_body () {
if (editWin == null) { alert (" oops editWin window is null"); return } // wait and try again ?
var body = editWin.document.editPage.p7;
if (body ==null) { alert(' could not get body, editWin.document.editPage.p7 is null'); return }
body.value = 'hey, my new body is here...';
}

I supose i could go back to using location.replace, but would need to lanuch the timer first, and in fill_body i would have to find the form in the current document.  Guess i'll try that next...

The_FoxThe_Fox
Hi Guys,

I have wrotten a cross browser sforce control which takes all the fields from the email author.jsp and so thta I can fill them with nor hurdle.

Send me an email if you want it

PS there is a bonus as there is a generic query and delete function in javascript for use with what you want

chumbert at odyssey-group dot com
jmcturnanjmcturnan
Hi, I would love to borrow from the code you wrote for the S-Control. Can you email it to me? Thanks!!!





The_Fox wrote:
Hi Guys,

I have wrotten a cross browser sforce control which takes all the fields from the email author.jsp and so thta I can fill them with nor hurdle.

Send me an email if you want it

PS there is a bonus as there is a generic query and delete function in javascript for use with what you want

chumbert at odyssey-group dot com


Menix10Menix10

Hey FOX,

 

Can i have a copy of it as well...?

 

Thanks in advance...

 

Menny (menny@ortho-cad.com)

 

 

MyGodItsColdMyGodItsCold

I'm using p7 to set the body & wanted to include some blank lines. <br/> doesn't work (not HTML). \\n or \\n\\r doesn't do it either.

 

 

MyGodItsColdMyGodItsCold
%0A  (zero, capital A) does it.
MyGodItsColdMyGodItsCold
can subject text be sent in to come out bold?