How to specify contains in client script for multi-value list field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 10:13 AM
Hi guys, we are introducing a multi-select 'Impacted regions' field to our INC form (on a Major Incident tab).
Currently we have a script that sets e-mail recipients based on the Priority and a Customer field 'Member field' (which is a one value field).
We will want to update this client script off of the Impacted regions field (also on the INC form) instead of Customer Member firm so my question is how can we update it e.g. how can I specify 'contains' in the below example instead of == where the Newvalue could be up to 5 values and not just one?
if((newValue == 'TESTMEMBERFIRM') && (priority == 7)){
g_form.setValue('u_to', 'test@test.com');
}
In other words how could I say newValue contains 'USA' and 'Canada' - I'm not sure how the values in a multi-select list field are parsed.
Many thanks in advance,
DS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:43 AM
Thank-you Michael, I look forward to trying this out soon - I'm on leave for a few days now.
I presume creating the sys property is straight-forward. Talk soon, many thanks, Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:45 AM
Yes you can type "sys_properties.list" in your Filter navigator and then click New in there. Just name it something that makes sense to you and then update the code.
Have an enjoyable leave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 07:18 AM
In terms of specifiying an e-mail basically I need a way of saying if all regions send to a global e-mail address so I was wondering about doing this on character length found?
Basically I need to set e-mail addresses like below:
If Priority = P1 (i.e., major incident):
If Service Regions includes | Set u_To as |
All regions (you could just check length of string or look for 4 commas?) | Global email address |
ELSE |
|
Australia | Aus email |
Canada | Canada email |
EMEA | Emea email |
South Africa | South Africa email |
USA | Usa email |
AND THEN always add | Misc email |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 08:00 AM
You should be able to do this in the email notification instead, which I assume you are using to send the email? You can insert a mail script to check the lengh and change the To email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 08:21 AM
Hi - We're using an e-mail client template for the content of the e-mail itself.