Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

In console application not getting attribute value

$
0
0

Hi Folks , 

I have a requirement in which I have to assign the value of field1 in field2.For that i have written a console application .
field2 is new field so it is blank . data type - Currency
field1 - some of the value is blank . Data type - Text

QueryExpression qe = new QueryExpression();
qe.EntityName = "opportunity";
qe.ColumnSet = new ColumnSet();

//qe.ColumnSet.AllColumns = true;   //  tried this also 
qe.ColumnSet.Columns.Add("new_filed1");  
qe.ColumnSet.Columns.Add("new_filed2");  

// qe.ColumnSet = new ColumnSet(new string[] { "new_field", "new_field" });  ////  tried this also 

// Condition where task attribute equals account id.
ConditionExpression condition = new ConditionExpression();
condition.AttributeName = "statecode";
condition.Operator = ConditionOperator.Equal;
condition.Values.Add(0);
qe.Criteria.AddCondition(condition);

EntityCollection ec = crmService.RetrieveMultiple(qe);    // I am not getting attribute new_field, new_field

foreach (Entity r in ec.Entities)
{
   r.Attributes["new_calculatedrevnue_base"] = (Money)r.Attributes["new_calculatedrevnue"];
}

Please suggest


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images