Dynamics Crm 2013 get all column doesnt work

Tuesday, July 1, 2014

Im using dynamics crm 2013 and sdk. I wrote code below and try to getting all column for entities but doesnt work.


And my second problem is that I want to getting one column for example "new_onaysayisi" but return column is "contactid" .



public static List<Entity> GetEntityList(string entityName, int memberType)
{
GetOrganisationService();

var query = new QueryExpression
{
EntityName = entityName,
ColumnSet =new ColumnSet("new_onaysayisi"),
Criteria = new FilterExpression { FilterOperator = LogicalOperator.And },
};

query.Criteria = new FilterExpression();

query.Criteria.Conditions.Add
(
new ConditionExpression("new_uyelikturu", ConditionOperator.Equal, memberType)
);


var entities = _service.RetrieveMultiple(query).Entities.ToList();



return entities;

}


Something is wrong but i couldnt find the solution.


Where am i wrong? Thanks for help.



public static List<Entity> GetEntityList(string entityName, int memberType)
{
GetOrganisationService();

var cs = new ColumnSet { AllColumns = true };
var query = new QueryExpression
{
EntityName = entityName,
ColumnSet =cs,
Criteria = new FilterExpression { FilterOperator = LogicalOperator.And },
};

query.Criteria = new FilterExpression();

query.Criteria.Conditions.Add
(
new ConditionExpression("new_uyelikturu", ConditionOperator.Equal, memberType)
);


var entities = _service.RetrieveMultiple(query).Entities.ToList();



return entities;

}`






http://ift.tt/1vuLzRA