The CreatorCon Call for Content is officially open! Get started here.

Is it possible to configure an onload client script to for the email client?

peterscaramuzzo
Tera Expert

I know that it is possible for users to email information via the Email Client option available for table forms like incidents. There is some concern that users could be including confidential information. Is there a way to run an onload script to post a warning? I was looking at the Email Client Templates and there doesn't appear to be something that I can directly hook onto for the onload action. Anyone know if this is possible?

1 ACCEPTED SOLUTION

KKM's UI Script code with a few modifications worked for me.

(function() {
    function showWarning() {
        if (window.top.document.title.includes("Compose Email")) {
            alert("Warning: Do not include confidential information in emails.");
        }
    }
    window.onload = showWarning;
})();

View solution in original post

15 REPLIES 15

That worked!!!! I like that it is targeted and displays nicely!!!! Thanks to you and KKM!!!!

@peterscaramuzzo - Thanks for accepting the solution provided and appreciate your vote on the "like" icon. 

@DrewW - Appreciating you on accepting the solution provided and it worked for you. The comments given to me that means and values a lot.

FYI this initial solution was a HUGE help as I have said. I did look into modifying it so there is banner at the top instead. As the user told me they might pay more attention to that which I agree. Here is my modified solution FWIW in case anyone can use this.

 

(function() {
function showWarning() {
if (window.top.document.title.includes("Compose Email")) {
showBanner();
}
}
window.onload = showWarning;
})();
function showBanner()
{
var elemDiv = document.createElement('div');
elemDiv.style.cssText = 'width:100%;height:20%;background:rgb(192,192,192);color:red; font-weight:bold;margin-left:auto;margin-right:auto;font-size:1.2em;';
elemDiv.innerHTML = "<br/> <i><u>Warning:</u></i>&nbsp; Do not include sensitive information" ;
elemDiv.style.textAlign = 'center';
window.document.body.insertBefore(elemDiv, window.document.body.firstChild);
}

peterscaramuzzo
Tera Expert

I like where you are going with this Mahesh!!!! I was thinking a UI Action with this in the script; alert("TEST"); for table sys_email_client_template but no luck. Is it because as you said Drew it is because this is not the table that ultimately opens the UI page? I am not sure how a UI Script can be targeted for that email dialog box opening?