
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 10:35 AM
Hi All,
as I learned the hard way, just using mail scripts in the body (that will derive the proper from and reply_to values) will not work
But ok ... for the reply to I can use some easy js like "javascript:current.assignment_group" .... BUT how to go ahead with more complex script which I need to define the FROM field?????
PLEASE HELP.
Best would be to be able to add a email script .. but this does not work (tried like in the body with ${mail_script:abc_scipt_client}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:41 PM
You can write a script include and call the script include in the java script. in script include, you can include the validation of assignment group.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:15 PM
can you change the notification email script to and remove anythingelse
gs.log('+++++++++++++inside cms_test_form notification script+++++++++++++++++');
email.setFrom("abc@xxxxx.com");
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:26 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:34 PM
Looks like ail script doesnt work. See if the below option works for you.
http://wiki.servicenow.com/index.php?title=Enabling_the_Email_Client#Creating_Email_Client_Templates
4.6.1 Setting the From Address with an Email Client Template
Use an email client template to set a default value for the From field if it should be different from the system default. For example, you can dynamically set the From field to the email address of the current user.
- Navigate to System Policy > Email > Client Templates.
- Select an existing template or create a new one. For example, select the Incident Template record.
- Configure the form to add the From field.
- Enter a script to add a default value to the From field.
For example, the following script displays the current user name and the current user email address.
javascript:gs.getUserDisplayName() + " <" + gs.getUser().getEmail() + ">"
The email client dynamically generates the email address, as shown.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:39 PM
.. this is not working for me as I need to validate an assignement_group field as well as some sys_user fields to derive the from field as well as having some possible fallbacks to be taken care of ... how can I add this (like new GlideRecord validations) after the "javascript:" ? I do not understand the syntax if the code is longer than just current.assigne.to ....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 12:41 PM
You can write a script include and call the script include in the java script. in script include, you can include the validation of assignment group.
Please mark this response as correct or helpful if it assisted you with your question.