Record Link showing wrong label but linking to correct record

Certified Lead Developer

I have a linkField with a recordLink. It displays the wrong label, but when I click the link it takes me to the correct record. 

My main table has two columns that are foreign keys to another table for contacts.

Ex. Main table has columns primaryContact and secondaryContact. Row 1 has primaryContact 1 and secondaryContact 2.

The 1 and 2 are foreign keys that reference the Contacts Table, with columns id and name. Row 1 has id 1 name Michael. Row 2 has id 2 name Luis.

Ex record link:

a!recordLink(

label: ri!record[recordType!MainTable.relationships.ContactsTable.fields.name],

recordType: recordType!ContactsTable,

identifier: ri!record[recordType!MainTable.fields.secondaryContact]

)

The expected behavior is to see the name Luis and when the user clicks Luis, it displays Luis's record. 

The actual behavior is it shows the name Michael and when the user clicks Michael, it displays Luis's record. 

So, it is displaying the wrong label, but the correct record.

I know I can write and expression rule to get the correct label, but can someone explain why the above does not return the correct label?

  Discussion posts and replies are publicly visible