UI Page: Set reference fields

Jake Sadler
Kilo Sage

How do I set the a reference field value in a ui page?

I currently have this:

HTML:

 

<g:ui_reference name="assigned_to" id="assigned_to" table="sys_user" query="active=true" completer="AJAXReferenceCompleter" ng-model="user" mandatory="true"/>
 
Client script:

function setRef(field,value){
gel('sys_display.'+field).value = value;
}
 
Does anyone know how to set the other attribute values like lookup and the actual value?
1 ACCEPTED SOLUTION

I don't think there is any official documentation for it. This is what is known to me:

 

  • id – unique id for the input field
  • name – unique name for the input field (should be the same as id in most cases)
  • value – (optional) sys_id of the record selected by default
  • displayvalue – (optional) display value of the record selected by default
  • table – name of the table to query from
  • query – encoded query string to pre-filter the list (i.e. a reference qualifier)
  • completer – AJAXReferenceCompleter (default) or AJAXTableCompleter
  • columns – a semicolon-separated list of fields to display in the dropdown (only works with AJAXTableCompleter)
  • onChange – client-side code to execute when the value changes

View solution in original post

5 REPLIES 5

how to set value in assigned to from different reference field from the same table in UI page?