locked
'Connection' entity doesn't contain attribute with Name = 'ConnectionId'. RRS feed

  • Question

  • Ms Dynamics CRM 2011 - rollup 8

    the following code produces this error during execution of the the last line in the code example

    any ideas?

                    QueryExpression Qry = new QueryExpression("connection")
                    {
                        ColumnSet = new ColumnSet("ConnectionId"),
                        Distinct = true,
                        Criteria = new FilterExpression(LogicalOperator.And)
                        {
                            Conditions =
                            {
                                new ConditionExpression("record1id", ConditionOperator.Equal, fCrmEntityInstance.Id),
                                new ConditionExpression("record2id", ConditionOperator.Equal, RelatedEntityId),
                                new ConditionExpression("statecode", ConditionOperator.Equal, 0)
                            }
                        }
                    };
    
                    EntityCollection coll = fOrgService.RetrieveMultiple(Qry);


    • Edited by whuygen Tuesday, August 6, 2013 2:08 PM corrections in code
    Tuesday, August 6, 2013 2:05 PM

Answers

  • ok,

    found the problem :

    ColumnSet = new ColumnSet("connectionid"),
    
    (lowercase) fixes it...

    Tuesday, August 6, 2013 2:09 PM