- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 06:23 PM
Hello,
I am looking to populate incident description based on the variable selected from the record producer. Currently, the script is working as it should but because I have several select box type variables for zone, I am not able to get others to populate in the description field except one zone
Script:
current.description = '\n Comment: ' + producer.description + '\n Target is Located at: ' + producer.target + '\n Zone is: ' + producer.red_zone;
What i am having issues with is populating the description field based on the selected zone. The above script works well for red_zone but i have green_zone, yellow_zone, blue_zone, white_zone and brown_zone and trench_zone and i want the description field to show when any of the other zones is selected. Please provide guidance
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 09:01 PM
Hi,
Try this.
var zones=' ';
if(producer.red_zone)
{
zones=zones+producer.red_zone;
}
if(producer.yellow_zone)
{
zones=zones+' '+producer.yellow_zone;
}
So on...
current.description = '\n Comment: ' + producer.description + '\n Target is Located at: ' + producer.target + '\n Zone is: ' +zones
Thanks,
Pooja M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 08:45 PM
Var zones="";
if(producer.red_zone)
{
zones=zones+producer.red_zone+" ";
} if(producer.green_zone)
{
zones=zones+producer.green_zone+" ";
}
Check.this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 09:01 PM
Hi,
Try this.
var zones=' ';
if(producer.red_zone)
{
zones=zones+producer.red_zone;
}
if(producer.yellow_zone)
{
zones=zones+' '+producer.yellow_zone;
}
So on...
current.description = '\n Comment: ' + producer.description + '\n Target is Located at: ' + producer.target + '\n Zone is: ' +zones
Thanks,
Pooja M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 09:16 PM
I have tried and it is working fine in my PDI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 10:06 PM
Thanks Pooja, This worked fine.