title: How to Inner join with query expression crm
body: <p>I'm trying to do a simple inner join with Query Expression. I'm trying to covert this query with QE but I got always the same error.  I'm doing this QE: </p>
  
  <pre class="lang-cs prettyprint-override"><code>Entity Role = new Entity();
  Role.LogicalName = "role";
  
  Entity SystemUserRoles = new Entity();
  SystemUserRoles.LogicalName = "systemuserroles";
  
  QueryExpression query = new QueryExpression() {
    Distinct = false, EntityName = Role.LogicalName, ColumnSet = new ColumnSet("name"),
  
    LinkEntities = {
      new LinkEntity {
        JoinOperator = JoinOperator.Inner, LinkFromAttributeName = "roleid", LinkFromEntityName = Role.LogicalName, LinkToAttributeName = "roleid", LinkToEntityName = SystemUserRoles.LogicalName,
      }
    },
  
    Criteria = {
      Filters = {
        new FilterExpression {
          FilterOperator = LogicalOperator.And, Conditions = {
            new ConditionExpression("systemuserid", ConditionOperator.Equal, "9b1bf31d-ac29-e211-9826-00155d0a0b0f"),
  
          },
        },
  
      }
    }
  };
  
  ret = _service.RetrieveMultiple(query);
  </code></pre>
  
  <p>to get this: </p>
  
  <pre><code>SELECT b.Name
    FROM Role b
     INNER JOIN SystemUserRoles a
     ON a.RoleId=b.RoleId  
      WHERE SystemUserId = '9b1bf31d-ac29-e211-9826-00155d0a0b0f'  
  </code></pre>
  
  <p>but this tells me the that the entity Role doesn't contain the field <code>SystemUserId</code>. Any idea?</p>