• si402
  • 0 Points
  • Member since 2009

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 0

I am trying to write a fairly straightforward SOQL query, which is not working how i'd expect. 


// Substituting valid where criteria for etc...

sObject Temp = Database.query('SELECT Contact.Account.Name FROM Contacts WHERE etc.');



I get an 'Invalid field 'contact.account.name'' error whenever i try this.


I've tried these variations and all of their various capitalizations (not that it should matter)




Obviously, this works:


Contact Temp = [SELECT Contact.Account.Name FROM Contacts WHERE etc.'];



But I need to be able to build the query string dynamically, querying against arbitrary salesforce objects. I feel like i'm just missing something simple, but I've been over the documentation numerous times with no luck.


Any assistance anyone could offer would be greatly appreciated.









  • April 29, 2010
  • Like
  • 0
I've spent a while going through the Metadata and Apex documentation looking for a way to add a custom button to an object's detail page programatically, and can't seem to find anything.
Our project team is attempting to create a wizard that runs post-package-installation that can create custom buttons on arbitrary objects depending on the particular org's object schema some one-time user input.
As an example, I'd like to be able to attach a custom button w/ user-defined text and url on the Account object details page without requiring the user to enter setup -> customize -> accounts -> buttons and links, and instead, do it through apex or one of the APIs.
Would anyone be able to tell me if this is even possible on the force platform, and if so, the best way to go about it?

Message Edited by si402 on 01-19-2009 03:03 PM
  • January 19, 2009
  • Like
  • 0