I have a lwc component, In order to show WorkORder details page I need a relatedField on a relatedObject wich is Location.Name. I have used two methods

  • import LOCATION_NAME_FIELD from "@salesforce/schema/WorkOrder.Location.Name"
  • @wire(getRecordUi, {
        recordIds: "$locationId",
        layoutTypes: "Full",
        modes: "View",
        optionalFields: [

and I still don't get any value , my question is Location Object supported ?

2 Answers 2


I think you want the relation name instead of the actual field API name. Try this:

import LOCATION_NAME_FIELD from "@salesforce/schema/WorkOrder.Location.Name"
  • still doesn't work
    – collin
    Nov 25, 2019 at 14:43

Based on the list of supported objects here, https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started_supported_objects.htm, it would appear Location is not a supported Standard Object.


The wire adapters and JavaScript functions in lightning/ui*Api modules are built on User Interface API. User Interface API supports all custom objects and many standard objects.

Lightning web components can access Salesforce data and metadata from all custom objects and from all the standard objects that User Interface API supports.

It would be easier to do this in apex to get the values you need, so create a controller class and add a method like the following...

public static WorkOrder getWorkOrderDetails(Id recordId) {
  return [SELECT Id, Location.Name FROM WorkOrder WHERE Id = :recordId];

Then in your lwc controller, add something like this...

import getWorkOrderDetails from '@salesforce/apex/somecontrollerclass.getWorkOrderDetails';

@wire(getWorkOrderDetails, {recordId : '$locationId'})wiredDetails

Then you can reference wiredDetails.data.Location.Name to display the data.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .