With Field Service Lightning, a Location object was added. When we try to work with this object it's always saying that we are referencing the System.Location object. How can I reference the Location object from FSL in Apex?


You need to explicitly reference the field service Location object as Schema.Location since just saying Location implicitly refers to the older System.Location class.

  • Thanks for this answer. I was stumped on the same thing and was just about to post a new question. – ArtieBrosius Jul 18 '17 at 18:01

You can access FSL Location by using Schema.Location. This worked for me:

for(Schema.Location loc : [SELECT Id,Name FROM Location]) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.