g:ui_choice_input how to add incident close codes

Jake Sadler
Kilo Sage

I have a jelly choice field (g:ui_choice_input) on a ui page that I'd like to add the incident close codes into. What is the easiest way to do this?

1 ACCEPTED SOLUTION

Ahmmed Ali
Mega Sage

Hello @Jake Sadler 

 

One way is to use GlideChoiceList to get choice values and use them in select tag.

Example:

<g:evaluate var="jvar_not_important" expression="var choices = GlideChoiceList.getChoiceList('incident', 'category');" />
	<select id="list" class="form-control" name="list" aria-required="true">
		<g:options choiceList="${choices}" />
	</select>

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

6 REPLIES 6

Arun_S1
Tera Guru
Tera Guru

@Jake Sadler  Not sure if I understand your requirement, you meant to say that the Choice field in the UI page should display the list of closure codes that are displayed on the incident form?

Hi, that is correct, I want to display close codes in the choice list for the incident table.

Ahmmed Ali
Mega Sage

Hello @Jake Sadler 

 

One way is to use GlideChoiceList to get choice values and use them in select tag.

Example:

<g:evaluate var="jvar_not_important" expression="var choices = GlideChoiceList.getChoiceList('incident', 'category');" />
	<select id="list" class="form-control" name="list" aria-required="true">
		<g:options choiceList="${choices}" />
	</select>

 

Thanks,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

If you want to apply query to get particular choice values, you can write GlideRecord to query the sys_choice table. You can find example of same in OOTB UI Page: consumable_split

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali