Creating an if else statement in Record Producer where it won't select the first option, automatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2020 04:05 PM
Hi,
I'm having an issue where I am trying to create an if-else statement in Record Producers against a multiple-choice, to be seen in an Incident ticket's short description field. Even though I select option two, it displays the variable for option 1. If I just use If statements, it's the reverse, it selectin option 3.
What am I doing wrong?
var shortDescriptionValue1 = producer.short_description.getDisplayValue() + ' issue' + ' for ' + producer.caller_id.getDisplayValue() + ', Vehicle #: ' + producer.vehicle_number;
//example: "Mobile Radio issue for John Doe, Vehicle #: 1234"
var shortDescriptionValue2 = producer.short_description.getDisplayValue() + ' issue' + ' for ' + producer.caller_id.getDisplayValue() + ', Property or Serial Number #:' + producer.property_number.getDisplayValue();
//example: "Handheld/Portable Radio issue for John Doe, Property or Serial Number #: 1234"
var shortDescriptionValue3 = producer.short_description.getDisplayValue() + ' issue' + ' for ' + producer.caller_id.getDisplayValue();
//example: "Dispatch Consoles issue for John Doe"
if(producer.short_description == 'mobile_radio');
{
current.short_description=shortDescriptionValue1;
} elseif(producer.short_description == 'handheld_portable radio');
{
current.short_description=shortDescriptionValue2;
} elseif(producer.short_description == 'dispatch_consoles');
{
current.short_description=shortDescriptionValue3;
}
- Labels:
-
Incident Management
-
Service Desk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2020 06:41 PM
Yea, nice work by Matthew to try and help here, but I would highly recommend you look up Javascript formatting/usage for this situation, just to educate yourself fully on how to use these things. While you're pretty close in some parts, other things are incorrect and are causing issues here. So we'd want you to learn WHY to do things in a certain way as well.
https://www.w3schools.com/js/js_if_else.asp
Just a learning opportunity.
Hope your issue is resolved!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2020 11:35 AM
Again, heh, just like what just happened above...Jeff...you really need to look over the formatting, so you learn it.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!