Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

what is wrong in this syntax?

$
0
0

Hi all,

 

CrmSdk.ConditionExpression conditionPrincipalc1 =
                                            new CrmSdk.ConditionExpression();
                    conditionPrincipalc1.AttributeName = "new_name";
                    conditionPrincipalc1.Operator = CrmSdk.ConditionOperator.Equal;
                    conditionPrincipalc1.Values = new object[0];
                    conditionPrincipalc1.Values[0] = sProject;

                    CrmSdk.ConditionExpression conditionPrincipalc2 =
                                            new CrmSdk.ConditionExpression();
                    conditionPrincipalc2.AttributeName = "new_city";
                    conditionPrincipalc2.Operator = CrmSdk.ConditionOperator.Equal;
                    conditionPrincipalc2.Values = new object[0];
                    conditionPrincipalc2.Values[0] = sCity;

                    OrderExpression orderc = new OrderExpression();
                    orderc.AttributeName = "new_name";
                    orderc.OrderType = OrderType.Descending;

                    // Create the FilterExpression
                    CrmSdk.FilterExpression filterPrincipalc = new CrmSdk.FilterExpression();

                    // Set the FilterExpression's Properties
                    filterPrincipalc.FilterOperator = CrmSdk.LogicalOperator.And;
                    filterPrincipalc.Conditions = new CrmSdk.ConditionExpression[] { conditionPrincipalc1, conditionPrincipalc2 };

                    // Create the Query Expression
                    CrmSdk.QueryExpression queryPrincipalc = new CrmSdk.QueryExpression();

                    // Set the QueryExpression's Properties
                    queryPrincipalc.EntityName = CrmSdk.EntityName.new_assigncallcenterusers.ToString();
                    queryPrincipalc.ColumnSet = new CrmSdk.AllColumns();//colsPrincipal;;
                    queryPrincipalc.Criteria = filterPrincipalc;
                    queryPrincipalc.Orders = new OrderExpression[] { orderc };
                    //  queryPrincipal.Orders = new OrderExpression[] { order };
                    /// Retrieve the Lead details.

                    CrmSdk.BusinessEntityCollection multiretrieved = crmService.RetrieveMultiple(queryPrincipalc);

and what is conditionPrincipalc2.Values = new object[0];

y the parentheses having value as 0??am receving error after i write the second consitional principle.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>