Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

FetchXML: Some Attributes Missing from Query Even When Using all-attributes

  • 1.  FetchXML: Some Attributes Missing from Query Even When Using all-attributes

    SILVER CONTRIBUTOR
    Posted May 27, 2020 10:31 AM
    Edited by Rodrick Hales May 27, 2020 12:45 PM
      |   view attached
    I created a SQL Server Reporting Services (SSRS) report in SQL Server Data Tools (SSDT) for Visual Studio 2015.

    When using FetchXML to query a for a dataset, some attributes are missing from the return data... even when using the all-attributes tag.

    The attribute in question is a lookup field type and sometimes it may be null. I recently made the field required and added data to each field for that entity and still the attribute is missing from the returned data.

    I attached the error I receive when I attempt to add it to the FetchXML explicitly.

    Please let me know if I am doing something wrong with when using the all-attributes tag or with lookups/optionsets in the FetchXML.

    P.S. I also did an Advanced Find and the attribute in question and it came back just fine. I copied the same downloaded FetchXML to SSDT and the query still failed with attribute not found.

    Thanks.


    ------------------------------
    Rodrick Hales
    Vertex Aerospace
    Madison
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: FetchXML: Some Attributes Missing from Query Even When Using all-attributes

    Posted May 28, 2020 09:00 AM
    Edited by Tim Miller May 28, 2020 09:01 AM
    Is it possible for you to share the actual FetchXML?  I'm just now moving to the cloud and will have to convert to fetch, so I won't know how to help but I'm interested in seeing what someone else can say (but expect they would need to see the fetch).  If data is coming back except for this one field, it seems that the problem would have to be in the fetchxml itself.

    ------------------------------
    Tim Miller
    IT Manager
    R.L. Deppmann
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: FetchXML: Some Attributes Missing from Query Even When Using all-attributes

    SILVER CONTRIBUTOR
    Posted May 28, 2020 09:53 AM
    Hi Rodrick,

    I have experienced a variety of issues in working with FetchXML in SSRS but this error I don't recall seeing. Without seeing the report it is a little difficult to point you in the right direction but I'll share a few observations.

    Don't use the all-attributes in FetchXML builder to get your fields. There are a bunch of additional fields that have an attribute type of virtual that cannot be used and will cause a query error. Select the fields you want explicitly.
    Multi-select Option Sets cannot be used in SSRS reports and it will cause a query error.
    For lookup fields there will be two attributes that you will find e.g. on an opportunity the Account field will have parentaccountid and parentaccountidname. You want to use parentaccountid. This will bring in three fields in your data set: parentaccountid, parentaccountidValue, and parentaccountidEntityName. The one that will show data in your report is the base field, parentaccountid.

    I know this is a shotgun approach to your question but without more info I'm hoping this hits on something or at least gets close.

    ------------------------------
    Scott Florance
    Business Applications Consultant
    KTL Solutions, Inc, Frederick MD
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: FetchXML: Some Attributes Missing from Query Even When Using all-attributes

    SILVER CONTRIBUTOR
    Posted May 28, 2020 11:23 AM
    Hello everyone. Someone created another entity of the same name. I'm so sorry for the confusion.

    Thanks for all the responses.

    ------------------------------
    Rodrick Hales
    Vertex Aerospace
    Madison
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role