Get Display Value from Choice List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 01:12 PM
Hello,
I created a UI Action where I query a table from the CMDB and update data on a form with the results on a Catalog Task page. One of the values I am retrieving is a Choice List and I would like to get the display value and populate on the other page, but it is not working.
Here is the code I am using where rec.operational_status is the retrieved value.
current.u_operational_status.setDisplayValue(rec.operational_status.getDisplayValue());
Is there something I am missing to make this work?
Thanks!
Mark Didrikson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 01:32 PM
I don't think you're missing anything. Choice List fields don't currently support a setDisplayValue() method that does what you're trying to do. There's just setValue(). I think setDisplayValue for a Choice List will simply end up using setValue instead.
I do not know the reason why getDisplayValue for Choice Lists was enhanced to work as expected and setDisplayValue was not - perhaps had something to do with concerns about internationalization, or perhaps just that the need wasn't there at the time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2012 01:41 PM
It might be a pain, but you could probably query the sys_choice table for the name/element/language/label combination you need, get the value that way, and set the value in the choice list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2012 05:09 PM
Thanks for the responses! I appreciate it!
Mark Didrikson