locked
FetchXML query only returns 8 attributes of 13 attribute RRS feed

  • Question

  • Hey everyone,

    When I run this FetchXML query it only returns 8 of the 13 attributes I requested. Has anyone ever seen this before? I can post the code but as far as I know there was not a limit.

    RDJ

    Wednesday, August 8, 2012 6:37 AM

Answers

All replies

  • Hello,

    In case attribute doesn't contain value (it is equal to null) it would not be returned in result xml.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    Wednesday, August 8, 2012 6:43 AM
    Moderator
  • in retrieve method if the attribute does not contains value it does not return any value in the entity collection

    for that purpose just make a condition like

    if (result.attribute.contains(''fieldname")==true)

    {

    }

    else{

    passes some null or undefined value into it

    }


    ms crm

    Wednesday, August 8, 2012 8:32 AM
  • Thanks. I'll have to remember that in the future.
    Wednesday, August 8, 2012 2:00 PM
  • Hi Richard,

    Whats the solution to get the attribute name, when I query using fetchxml there are 12 attributes so when I get 8 attributes as results their names are somewhat different. My code is dynamic so I use the attribute name as input parameter to get data values.

    Suppose I mention attribute name as "<attribute name='fullname'/>" in fetchxml query the result I used to get in entity is like "cdi.fullname"

    eg:

    e.FormattedValues.Contains(_attributeName)  // Here I used to pass the attribute name as input parameter whatever I have mentioned attribute name in fetchxml query however it used to be key error so I used to get result in enitity and used the entity key attributes to get the values.

     


    • Edited by harshu288 Friday, November 25, 2016 11:07 AM corrected
    Friday, November 25, 2016 11:06 AM