I'm using Apex-lang to build queries. http://code.google.com/p/apex-lang/

problem: A custom lookup field won't show up in the generated query.

If I duplicate the SoqlBuilder class and use the new class, the custom field will show up.

Could there be some FLS on class level that I'm missing? I tried this using Anonymous Apex.

  • What API version is the non-working class? Can you confirm the API version of the two classes are the same?
    – Mikey
    Jun 3, 2013 at 15:34
  • The non-working class is API version 13.0 If I change it to 28.0 it is working. Do you know by any chance the creteria for fields to show up in API 13.0?
    – user2965
    Jun 4, 2013 at 7:16
  • Not off the top of my head. Here's a resource that shows what has changed in each API Version. I'm wondering if lookup fields weren't added until after API 13.0 salesforce.com/us/developer/docs/api/Content/whats_new.htm
    – Mikey
    Jun 4, 2013 at 14:23
  • Ok, thanks for the link. I'll play with the API Version to see where it fails. You may add your comments as an answer, so I can mark it as the best.
    – user2965
    Jun 10, 2013 at 12:09

1 Answer 1


If the API version of the classes are different, this could be causing the issue. New features are versioned within the API, to maintain backward compatibility. If a feature was added after the API version of the class, it will not be accessible.

Take a look at this documentation to see what features were added in what API version.

  • 1
    lookups to junction objects were added after v13
    – superfell
    Jun 10, 2013 at 17:02

You must log in to answer this question.

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