web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

ConditionOperator.In example

(0) ShareShare
ReportReport
Posted on by 65

Hi

  I need to import entityimage(byte array[]) from D365 CE Contact entity.

I need to bring all contacts with entityimageurl is not null.

I have imported contact entity to local sqldb using DES. I can see imageurl field but not entityimage field(byte array)

I have created console application which

1. Reads all contacts with entityimageurl IS NOT NULL  (stores all contactsid into an array)

2. The same contactid(s) I need to supply as filters to 

QueryExpression qe = new QueryExpression("contact");
qe.ColumnSet.AddColumns("contactid", "entityimage", "createdon", "modifiedon");
qe.Criteria.AddFilter(filter1);
qe.Criteria.AddFilter(filter2);
//qe.Criteria.AddFilter(filter2end); //used when using between dates and times
//qe.Criteria.AddFilter(filter3);

EntityCollection result = Service.RetrieveMultiple(qe);

How can I pass contacts array to QueryExpression?

In sql world, I need something like IN operator

Regards

Raj

I have the same question (0)
  • Suggested answer
    Manoj Mane Profile Picture
    1,020 on at

    Hi rajkm,

    You can refer the below query syntax.

    In this contacts is your array. 

    var
    queryExpression = contacts.map(contact => { return 'SELECT * FROM contacts WHERE firstName = "' + contact.firstName + '" AND lastName = "' + contact.lastName + '" AND
    phone
    Number = "' + contact.phoneNumber + '"'; });


    Thanks,
    Manoj Mane.

    Please mark this as VERIFIED if it helps. image


  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
  • rajkm Profile Picture
    65 on at

    Hi Manoj Mane

    Thanks for the reply.

    If the query returns even 900 rows, I am getting error "Query timeout or max size limit of 208MB reached

    I thought of looping for each ContactId returned from sql query but I was told that it will send multiple requests to CRM and it may crash the live system.

    What is the alternate to return image(byte array) fields

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 36 Super User 2025 Season 2

#2
Shivani Padalia Profile Picture

Shivani Padalia 36

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans