- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020 11:58 PM
Hi,
I have a requirement to add Assignment group field whenever I click on create incident option from form context menu. IT displays a UI page. I am able to show the field but could not get the options like we get for assignment group field in normal forms (reference to Group table). I have written the below codeby which I am able to fetch the assignment group from the record but not getting all the options of group table:
<j:if test="${sysparm_action == 'incident'}">
<div class="row form-section">
<div class="col-sm-3 section-title-top">${gs.getMessage('Assignment Group')}</div>
<div class="col-sm-5">
<g:evaluate var="jvar_property">
var grList = GlideChoiceList.getChoiceList('sys_user_group','name');
</g:evaluate>
<select id="group" class="form-control" name="group" aria-label="group">
<g2:options choiceList="$[grList]" choiceValue="$[secInc.assignment_group.name.toString()]" />
</select>
</div>
</div>
</j:if>
What approch should I follow to get the record of sys_use_group table as a reference/option in my field?
thanks,
Gazal Varshney
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 02:52 AM
<g:macro type="text" name="REQUIRED" label="REQUIRED" value="" onkeyup="" onchange="onChange('${jvar_name}');" onclick_label="" mandatory="false" size="" style="" readonly="false" maxlength=""/>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 02:52 AM
<g:macro type="text" name="REQUIRED" label="REQUIRED" value="" onkeyup="" onchange="onChange('${jvar_name}');" onclick_label="" mandatory="false" size="" style="" readonly="false" maxlength=""/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 07:43 AM
Hi,
I am not able to map the value to the incident assignment group field i.e. as soon as i am submitting the form the value is not getting displayed while my text field values for categora nd subcategory are getting populated with the provided values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 11:47 PM
Hi Ashutosh,
My code is :
<j:if test="${sysparm_action == 'incident'}">
<div class="row form-section">
<div class="col-sm-3 section-title-top" >${gs.getMessage('Assignment Group')}</div>
<div class="col-sm-9">
<g:ui_reference mandatory="true" name="assignment_group" id="assignment_group" table="sys_user_group" query="typeISEMPTY^ORtypeLIKE1cb8ab9bff500200158bffffffffff62" completer="AJAXTableCompleter" ng-model="group" aria-required="true"/>
</div>
</div>
</j:if>
How to in cooperate your solution with my code? I am new to jelly scripting so finding it difficult to make my field mandatory.
Please hlep.
Thanks,
Gazal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 03:05 AM
you have to use g_form.setValue() in client script of UI page to set the value on form.
if you are new to Jelly i would suggest kindly have a look on below blog, it has mentioned one sample code to set the value of ui page to form.
https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 12:11 AM
Hi,
Use this:
Thanks,
Ashutosh