I have generic code in my org that retrieves all fields that are accessible by user

 public static String returnAllFields(String objectName){

    String fieldsCSV = '';

    for(Schema.SObjectField f: Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap().values()){

                DescribeFieldResult fr = f.getDescribe();

                  fieldsCSV += fr.getLocalName() + ',';

    fieldsCSV = fieldscsv.removeEnd(',');

    return fieldsCSV;


It was working fine till last week (prior to Spring 14). All of a sudden visual workflows (that use the above code via Plugin, running via System mode) started failing.

The error is 19:12:50.913 (85913028000)|EXCEPTION_THROWN|[125]|System.QueryException: No such column 'MailingAddress' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Not really sure why this is happening or if there is any way I can get around the error?

Suggestions: I was thinking of adding a Set of all the fields that I can exclude (possibly all compound fields). But it seems to be like not viable. Is there any other way I can identify if field is compound or not? (maybe a specific SOAPType? ). I tried searching documentation but didn't really find any.

Any help is appreciated...


1 Answer 1


Any classes that reference contact object will get this error unless they’re on API version 30

https://success.salesforce.com/issues_view?id=a1p30000000T3FOAA0.. So the simple solustion for your problem is update the version of your class to 30.

Also note that there can be classes that cannot be updated to API version 30 because they require test methods in separate test classes. for this you will need to move your test methods in test classes.https://developer.salesforce.com/forums?id=906F000000093MCIAY

  • Thank you, none of our test classes are within actual class, so i will change/re-compile all actual classes to v30.0 and see if it resolves the issue. Apr 28, 2014 at 12:40
  • @logontokartik I guess upgrading the version to 30.0 should resolve this . Apr 28, 2014 at 13:35

You must log in to answer this question.

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