- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2015 06:33 AM
In Record producers we have checkbox question as below
Capacity Sheet is Label and below values as checkboxes.
We want to map these checkboxes values in script section of Record Producers so it reflects in Notes field of Incident.
How can we do that. Please suggest
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 02:37 AM
You can loop through all the check boxes with a condition inside the loop to check if the check box is true.
var checkBoxVariables = [];
checkBoxVariables[0] = 'check_box_variable_1';
checkBoxVariables[1] = 'check_box_variable_2';
checkBoxVariables[2] = 'check_box_variable_3';
checkBoxVariables[3] = 'check_box_variable_4';
var checkBoxLabels = [];
checkBoxLabels[0] = 'check_box_label_1';
checkBoxLabels[1] = 'check_box_label_2';
checkBoxLabels[2] = 'check_box_label_3';
checkBoxLabels[3] = 'check_box_label_4';
for(var i=0; i<checkBoxVariables.length; i++) {
if(producer[checkBoxVariables[i]] == 'true') {
current.description += '\n' + checkBoxLabels[i];
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2015 07:01 AM
You can Access Check box variable using "producer"."check box variable name"
EX:
current.short_description += producer.test_check;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 02:16 AM
Hi,
Thanks for reply, I have added script as
if (producer.vsa_partner_forecast == 'true')
{
current.description += 'Capacity:VSA Partner Forecast';
}
This is working fine, but there are multiple checkboxes values, so is there way to short down script like using OR statement , verify which value is checked and display only that in notes field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 02:37 AM
You can loop through all the check boxes with a condition inside the loop to check if the check box is true.
var checkBoxVariables = [];
checkBoxVariables[0] = 'check_box_variable_1';
checkBoxVariables[1] = 'check_box_variable_2';
checkBoxVariables[2] = 'check_box_variable_3';
checkBoxVariables[3] = 'check_box_variable_4';
var checkBoxLabels = [];
checkBoxLabels[0] = 'check_box_label_1';
checkBoxLabels[1] = 'check_box_label_2';
checkBoxLabels[2] = 'check_box_label_3';
checkBoxLabels[3] = 'check_box_label_4';
for(var i=0; i<checkBoxVariables.length; i++) {
if(producer[checkBoxVariables[i]] == 'true') {
current.description += '\n' + checkBoxLabels[i];
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 04:48 AM
Thanks for help ...