Record Producer script issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 10:51 AM
This script works great except it doesn't change the type

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 05:12 AM
It looks like your field is of the type String. Is that correct? And it is dependent on the subcategory field?
A couple of things you may want to consider:
- In your script above, change the line that sets it to '-None-' to changing it to '' (null or empty string). That is the internal value for that choice.
- You may want to change the "Incorrect #" choice to remove the special character from the internal value. That may be okay, but I've never tried that on an internal value. I've used the slashes before, so I think your 'Disable/Remove' option is okay. The same might be true for your subcategory of "Abt Phone #".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:07 AM
This ended up working, but I don't completely understand why. Another failed test was
case requestType == 'retain_phone_license' so I'm really quite baffled.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:36 AM
What kind of variable is your producer.request_type and what are the available values for it? If it's a Select Box and the values are what you have in your if statement, then that part should work.
Resetting the testerVar variable in the middle of a switch statement could potentially mess things up.
I'm surprised the default choice is working since you are setting it to something that isn't a valid internal value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2024 10:20 AM
It's radio button choices. I did take your advice earlier and changed the default to "", but didn't paste that version.
The code above did eventually work. But I'm not sure I understand why it worked. I can tell you that I couldn't get the cases to work. I don't know if you noticed, but I also had to make the operator a loose equivalent in order for it to work.
I had even tried switch(requestType)
case requestType == 'retain_phone_license' etc. but that didn't work either.
Jeanne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 05:17 AM
Yes, It's dependent on the subcategory.
I've tried several combinations for the "none-of-the-above" option. They all seem to work, but I like your idea of the subcategory being the issue. I'm going to give that a shot and see if that changes anything. I'll be back in touch.