0

I have retrieved all the fields from contact using Schema.getGlobalDescribe() but when I try to perform query on retrieved field I get below error:

Invalid field Contact.EmailBouncedDate for Contact

  • 1
    Can you show us your code please? – Carlos Naranjo Feb 23 '17 at 15:54
  • Please share your code to help u better – Samir Feb 23 '17 at 16:05
0

Whatever the reason you cannot see this field, in general you should check if the field is accessible before adding it to your query.

for (SObjectField field : SObjectType.Contact.fields.getMap().values())
{
    if (field.getDescribe().isAccessible()
    {
        // can be added to query
    }
}

Note also that the development team intentionally did not build out SELECT * functionality. You should be cautious if you do so yourself.

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.