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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

RetriveMultiple not retrieving all the column values

(0) ShareShare
ReportReport
Posted on by 397

Hi,

I am trying to retrieve the data using RetrieveMultiple method. I am able to retrieve all the columns except one date time filed that one of our team mate created. Can you please confirm whether we need to apply any null conditions at the time of retrieving the data in case date field contains null values in system? If so how can we do that? I just wrote a simple straight forward query to retrieve the data I can see most of the columns except one date field that I need the value of.

QueryExpression qe = new QueryExpression();
qe.EntityName = "opportunity";
if (Columns == null)
qe.ColumnSet = new ColumnSet(true);
else
qe.ColumnSet = new ColumnSet(Columns);
qe.PageInfo.PagingCookie = "";
qe.PageInfo.PageNumber = PageNum;
qe.PageInfo.Count = 2500;
_service.RetrieveMultiple(qe);

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: RetriveMultiple not retrieving all the column values

    Please add the list of columns to your query expression as shown below. 

       QueryExpression qe = new QueryExpression();

       qe.EntityName = "opportunity";

       if (Columns == null)

        qe.ColumnSet = new ColumnSet(true);

       qe.ColumnSet.Columns.Add("name");

        qe.ColumnSet.Columns.Add("nameofothercolumn1");

       qe.ColumnSet.Columns.Add("nameofothercolumn1");

  • Suggested answer
    ashlega Profile Picture
    34,477 on at
    RE: RetriveMultiple not retrieving all the column values

    Hi,

     as Madhan suggested, that column name might be missing from the Columns variable.

     Another alternative - even though you might be passing all column names to the columnSet, if the field is not, actually, populated, you won't find it in the attributes of the record. In other words,

     entity["new_fieldname"]

    will throw an exception if, for that particular record, new_fieldname attribute has not been populated. You can check if the attribute is there by calling entity.Contains("new_fieldname")

  • Srini20 Profile Picture
    397 on at
    RE: RetriveMultiple not retrieving all the column values

    Thanks Madhan & Alex. My column already exist in column list and also I tried to query entire entity but couldn't find the columns related to null. I  just figured that column will not be in the result set if that contains null value.

    Thank you for quick response.

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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans