How to put filter conditions for a refrence field in UI Page

Rutusha
Tera Contributor

Hello all,

I have a requirement wherein I have a UI page on which we have let's say XYZ field and that field is referencing to sys_choice table.

However, I wanted to put filter as in whenever the user references XYZ field he should be able see certain records only from sys_choice table.

Could someone help me to achieve this in UI page. 

 

Thanks!!

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hey,

From what I'm understanding you're wanting a reference qualifier that restricts the options available on the reference field you've added to your UI page.

 

If you're using g:ui_reference you can specify a query

 

<g2:ui_reference id="my_choice_field" 
							name="my_choice_field" //Field name, used in client script to retrieve info
							table="sys_choice" //The table to query
							columns="name"
							columns_search="false" 
							order_by="name" 
							show_popup="false"
							query="inactive=false^element=XXX"
							completer="AJAXTableCompleter"/>

 

View solution in original post

2 REPLIES 2

Vishwa Pandya19
Mega Sage

Hi,

 

If you have created the reference field on the UI page using <g:ui_reference/> then you just have to add one more parameter called query.

E.G: <g:ui_reference id="abc" table="incident" query="active=true"/>

If my answer helped you in any way please mark it as correct or helpful. 

Kieran Anson
Kilo Patron

Hey,

From what I'm understanding you're wanting a reference qualifier that restricts the options available on the reference field you've added to your UI page.

 

If you're using g:ui_reference you can specify a query

 

<g2:ui_reference id="my_choice_field" 
							name="my_choice_field" //Field name, used in client script to retrieve info
							table="sys_choice" //The table to query
							columns="name"
							columns_search="false" 
							order_by="name" 
							show_popup="false"
							query="inactive=false^element=XXX"
							completer="AJAXTableCompleter"/>