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

Announcements

No record found.

News and Announcements icon
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 69

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
    69 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 151 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans