
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 05:42 AM
Hi All,
I am having the requirement to prompt the alert message when the user clicks "Send" button in the email client template. If you have any idea how to incorporate this changes?
(or) ui action to call ui page in the same way to show up the email client template and validation for the same.
Please do share the code that can achieve this functionality.
Thanks,
Priyanka R
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2019 05:41 AM
UI SCript to achieve 🙂
function manipulateEmailClient()
{
try{
if(document.URL.indexOf("/email_client.do?sysparm_table=") != -1){
document.getElementById("send_button").setAttribute("onclick", "alertme(event);");
}}
catch(e){
console.log(e);
}
}
function alertme(e){
e.preventDefault();
if (confirm("Are you sure to send an email")) {
sendIfOkay(event);
} else {
console.log("Error");
}
}
addLoadEvent(manipulateEmailClient);
Thanks, hope it will help if anyone needs in future!
-Priyanka R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 05:54 AM
Hi Priyanka,
You can add a script for your UI Action to do whatever is necessary before taking the final action. Here is a script that I have attached to a button to move an incident to a demand. The script first prompts to confirm that this is the action the user really wants to take and based on the reply either creates the demand or exits. I've attached a screen shot of the set up for the UI action below the script. You will need to determine what conditions are right for you.
Hope this helps,
:{)
function confirmCreateDemand() {
var debug = false;
var conf = confirm("Are you sure you want to CREATE THIS DEMAND?\n\n");
if (debug == true) {
g_form.addInfoMessage("Doing Create Demand, conf is " + conf);
}
if (conf) {
if (debug == true) {
g_form.addInfoMessage("In conf == true");
}
gsftSubmit(null, g_form.getFormElement(), 'createDemand');
}
else
return false;
}
if (typeof window == 'undefined')
doCreateDemand();
function doCreateDemand() {
// code that creates the demand goes here
}
:{)
Helpful and Correct tags are appreciated and help others to find information faster

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 10:37 PM
Hi, Thanks for your reply. Actually I need to do the validation in "SEND" button that we have in the email client template. Please find the attachment for the same. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2019 04:43 AM
Hi,
I'm not seeing any attachments :{(. When you say email client template are you talking about a template built in MS Outlook or something similar or a reply to an approval type request or the Send Email option from the ellipsis/more options at the top of some forms?
:{)
:{)
Helpful and Correct tags are appreciated and help others to find information faster

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2019 05:39 AM
Hi that's okay. Have found the solution using UI Script where I am showing the pop-up message when the user clicks on "SEND" button in the email client template.
Thank you so much for your help 🙂 🙂 have a good day ahead 🙂