3

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?

5

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
0

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

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

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.