title: How to get all populated columns from CRM using `QueryExpression` object?
body: <p>I've asked a similar question before <a href="https://stackoverflow.com/questions/13077691/not-all-columns-retrieved-on-new-columnsettrue-in-a-plug-in">here</a> and the answer solved my problem. However, now I'm getting the same problem as before <strong>but</strong> the answer doesn't work anymore due to change in conditions.</p>
  
  <p>Here's the query I'm running. I've checked that <code>someField</code> is set to something (it's a look-up field referring to an other entity by a guid). I get no entries in <code>result</code> (unless I switch the condition to "not equal"). That's probably due to the fact that the field isn't brought in.</p>
  
  <p>When i breakpoint the execution and check <code>Attributes</code>, I see 21 fields out of a total of 30 (some of them might be empty, sure, but <strong>this</strong> one, i.e. <code>someField</code>, is <strong>not</strong>) but the one I'm interested in, isn't there!</p>
  
  <pre><code>QueryExpression query = new QueryExpression
  {
    EntityName = "entity",
    ColumnSet = new ColumnSet{ AllColumns = true },
    // Here I tried the code addition #1 below
    Criteria =
    {
      Filters =
      {
        new FilterExpression
        {
          Conditions =
          {
            new ConditionExpression("someField", ConditionOperator.Equal, guid)
          }
        }
      }
    }
  };
  // Here I tried the code addition #2 below
  EntityCollection result = Service.RetrieveMultiple(query);
  </code></pre>
  
  <p>What do I miss and how can I resolve it?</p>
  
  <p>I tried using <code>LinkEntities</code> as discussed in <a href="http://crmdream.wordpress.com/2012/03/07/crm-2011-working-with-associatedeassociate-plugin/" rel="nofollow noreferrer">this blog</a> but it didn't really work out. I'm not even sure if it was a meaningful approach. It looked as follows.</p>
  
  <pre><code>  LinkEntities =
    {
      new LinkEntity
      {
        Columns = new ColumnSet { AllColumns = true },
        LinkFromEntityName = "entity",
        LinkFromAttributeName = "otherEntityId",
        LinkToEntityName = "entity2",
        LinkToAttributeName = "entity2Id"
      }
    },
  </code></pre>
  
  <p>I also tried to employ the <a href="http://msdn.microsoft.com/en-us/library/gg328149.aspx" rel="nofollow noreferrer">solution suggested on MSDN</a>. The same result.</p>
  
  <pre><code>request.LinkEntities.Add(
    new LinkEntity(
      "entity", "entity2", "otherEntityId", "entity2Id", JoinOperator.Inner));
  request.LinkEntities[0].Columns.AddColumns("entity2Id");
  request.LinkEntities[0].EntityAlias = "blobb";
  </code></pre>
  
  <p><em>Once again - the solution provided by @JamesWood isn't working anymore, since I've got the administrator access <strong>and</strong> the regarded field is not empty.</em></p>