Notifications

14 views

Symptoms

A reference field shows the correct display name, but the actual record is not the intended/expected record when examined or clicked through.

Release

London

Cause

This happens as a result of the following combined conditions:

  1. The reference field was set using setDisplayValue
  2. There are multiple records on the referenced target table which match the value

An example of this may be when there are multiple [sys_user] records for the same person or the same name, and a reference field like [caller_id] implements some custom logic that uses g_form or current's setDisplayValue (ex: John Smith).  If there are 2 John Smith users, the reference field's auto-completer will look up the name and return the first result it finds.

Resolution

To resolve the behavior, we recommend to always use 'setValue' for reference fields and pass in the precise 'sys_id' for the expected record.

Article Information

Last Updated:2019-03-19 17:49:03
Published:2019-03-20