Open JA-Brightgen opened 9 months ago
In these cases, the field which is meant to be used as the identifier typically has the property idLookup (As an example see the CaseNumber field of the Case Object Reference docs)
Although not listed in the docs, it appears there is also a nameField
property on these which might be more reliable as it's also set on normal Name fields (eg. Account.Name) too:
Hi @JA-Brightgen, This is true, most of the Sobjects have the Name field but not all of them.
The goal of this feature is to provide minimal info (and link) on the record when searched from the id in the Object tab without extra treatment or rest callout. When implementing the feature I've considered to use the nameField boolean but this would require an extra callout (or passing the entitydefinition results) and appeared as overkill for a minimal benefit.
Hey @tprouvot,
Understandable you wouldn't want to introduce new callouts just for this.
My Plan B that wasn't pretty but seems to cover all the sObjects I can think of would be to fallback onto potential field names in the order Name
, LineItemNumber
, <sObjectName>Number
, but as you say you'd still need to introduce additional callouts to go down this route as well.
I'll mark it as Won't Fix for now then, if I have any bright ideas I'll revisit this later on :)
@JA-Brightgen I could dynamically build the
I'll try to find a way to do it without throwing an error (because the actual implementation also does when there's no "Name" field which is not good..)
Make sure to read the troubleshooting section before creating an issue
Describe the bug In cases where an sObject does not have a Name field, the (Record) Name field of the popup is blank when viewing a record. Affected objects are typically standard objects that use an auto-number as an identifier - examples include Case, Contract, and WorkOrder.
To Reproduce Steps to reproduce the behavior:
Expected behavior A value for the Name: field should exist for any record.
Screenshots
Desktop (please complete the following information):
Additional context In these cases, the field which is meant to be used as the identifier typically has the property
idLookup
(As an example see the CaseNumber field of the Case Object Reference docs)