Display a count of Sites selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 04:53 AM
When the "Multiple Sites Visibility" checkbox is checked or unchecked, a message indicating the count of sites present in the 'Multiple Sites' field is displayed below the "Multiple Sites Visibility" field.
in the below image ,2 sites are selected. So message below 'Multiple Sites Visibility ' field should be - " Number of Sites affected are 2".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 05:08 AM
Hi
You can create a client script to achieve the same.
Create an Onchange Client script ..I have basic script below ..You can modify that accordingly
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
// Get count of sites from the 'Multiple Sites' field
var multipleSitesField = g_form.getValue('multiple_sites');
var sitesCount = multipleSitesField ? multipleSitesField.split(',').length : 0;
var message = 'Number of Sites affected are ' + sitesCount;
g_form.showFieldMsg('multiple_sites_visibility', message, 'info');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 05:22 AM
Please write onchange client script,
- Table: Your case table (e.g., case)
- Type: onChange
- Field: Multiple Sites Visibility (u_multiple_sites_visibility)
var multipleSites = gForm.getValue('u_multiple_sites');
// Count the number of sites (assuming they are comma-separated)
var siteCount = multipleSites ? multipleSites.split(',').length : 0;
// Display the message
gForm.clearMessages(); // Clear previous messages
gForm.addInfoMessage("Number of Sites affected are " + siteCount);
Please mark correct/helpful if this helps you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 05:27 AM
No.. Both are not working as expected. But Thanks for the promt reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 12:26 AM - edited 03-21-2025 12:28 AM
The solution is given below, We tried Script include .
Script include
Client script-