The “entityid” field of a customer record displays customer id and name. When fetching the “entityid” field value from a record using search.lookupFields, only the customer id is returned without the customer’s name.
search.lookupFields is optimized for quick lookup of field values and generally returns a simplified version of the data. “entityid” concatenates multiple pieces of information like customer id and customer name, lookupFields typically focuses on the primary data that is customer id and might not return the fully formatted “entityid” as it appears in the UI.
record.load().getValue(‘entityid’) returns both the customer id and customer name. When loading a record via record.load, NetSuite retrieves the full record context to return the full concatenated “entityid”, which includes both the customer ID and customer name as shown in the NetSuite UI.
Performance can be slower with record.load when working with a high volume of records. If it is required to fetch the full entityid, that is the customer Id and customer name through a search, then, fetch both the fields “entityid” and “companyname” through search.lookupFields and concatenate the field values to get the full value.