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

Adding conditions in service.RetrieveMultiple in c#

$
0
0

Hi ,

I am using service.RetrieveMultiple for retrieve data.

Code:

quotequery = new QueryExpression()
{
    Distinct = false,
    EntityName = modulename,
    ColumnSet = new ColumnSet(true),
    Criteria =
    {
        Filters = 
        {
            new FilterExpression
            {
                FilterOperator = LogicalOperator.And,
                Conditions = 
                {
                    new ConditionExpression("ownerid", ConditionOperator.Equal, userid),                                
                    new ConditionExpression(contactfield, ConditionOperator.Equal, lstcredential.Contactid.ToString())                                                  
                },
            }           
        }
    }
};
 queryentityCollection = _serviceProxy.RetrieveMultiple(quotequery).Entities;


i have above common function which has different different conditions at different different call so there is possibility to use some variable or something which stores conditions ans pass it in conditions={ }  like I use  modulename which stores entityname?or any other way?

Please suggest answer.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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