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

@peterscaramuzzo - Could you please share the error message snapshot. ?

 

Regards,

Krishna Kumar M

I didn't get an error nothing showed

DrewW
Mega Sage

Well I thought it was a UI Page but it is not so the page is a backend one that we do not have access to.

 

So if maheshkhatal suggestion does not work you can try a UI Script to see if a global UI Script loads when that page loads.  If not then you are going to have to put a banner announcement on the record form telling people not do put things in an email.

 

I am not sure how can a UI Script be targeted for the compose email action specifically? I suspect I can look if the title bar contains "Compose Email". However, it doesn't appear to be triggering a warning when adding an alert statement in the global script.

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;
})();