UI page -add reference field

tommyjensen
Giga Expert

I am experimenting with the add comments dialog example from the wiki here Displaying a Custom Dialog - ServiceNow Wiki

I would like to add another field to that dialog page but cannot find the relevant information about the different types of fields that can be added in at ui page.

I want to add a reference field for the caller field in the incident form. What is the syntax for that?

4 REPLIES 4

Deepa Srivastav
Kilo Sage

Please check below thread and also section 14 of the below link for syntax.



http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#gsc.tab=0




Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Thanks,
Deepa



UI Pages, GlideDialogWindow, and Reference Fields


ramireddy
Mega Guru

Hi,



You can add any type of field in UI page. If you want a reference field, which allows you to select any record from a table, you can use ui_reference table.


<g:ui_reference   id="mainrecord" table="u_childtable"   completer="AJAXTableCompleter" "id" onchange="ValueChanged()" />



You can use general HTML controls as well in UI pages.


tommyjensen
Giga Expert

Thanks for the examples but I already looked at both but I need a more exact example as well as a description of what each element means.


Hi,



Suppose, if you are creating a UI page, in that UI page, you want a reference field, which is like "Caller" field in incident table, you can place the following code.



<g:ui_reference name="QUERY:active=true" id="assigned_to" table="sys_user" />



If you look at above line, we used 3 attributes.



1. Query -> If you want to filter any rows by default, you can use that. I am displaying only Active users here.


2. id -> Id attribute is same like HTML controls. to uniquely identify this control in script section, we use this.


3. table -> From which table, you need the data.



Thanks


Rami Reddy