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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Facing issue in querry in D365, cant fetch

(0) ShareShare
ReportReport
Posted on by 836

I have two similar queries, my first one is working fine and result is coming in tabular format in fetchxml builder of xrm toolbox  but for second I am getting error useridname does not exist and querry is not running, then it opens xml format result which is not correct. below are two querries, with audit entity result is not poping up. Any ideas, why is that?


FIRST Query

<fetch top="50" aggregate="true" >
<entity name="msdyn_workorder" >
<attribute name="createdby" alias="CB" groupby="true" />
<attribute name="msdyn_workorderid" alias="UI" aggregate="count" />
<filter>
<condition attribute="createdon" operator="last-seven-days" valueof="cr4cb_typeofwork" />
</filter>
</entity>
</fetch>

SECOND Query


<fetch aggregate="true" >
<entity name="audit" >
<attribute name="auditid" alias="AIUpdate" aggregate="count" />
<attribute name="userid" alias="UIUpdate" groupby="true" />
<filter type="and" >
<condition attribute="operation" operator="eq" value="2" />
<condition attribute="createdon" operator="on-or-before" value="2/28/2022" />
<condition attribute="createdon" operator="on-or-after" value="2/2/2022" />
</filter>
</entity>
</fetch>

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Platform throw below error when I try to execute fetchxml from Rest builder Tool -

    {"error":{"code":"0x80040216","message":"Encountered unsupported attribute name: 'useridname' when converting entity expression to SQL.","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey":"Plugin/Microsoft.Crm.ObjectModel.AuditService","@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey":"966fd693-ed83-4c75-bfe0-2907d678d6ca","@Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey":"1","@Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey":"811b9394-c7d3-4451-a93d-1ad41df8c1b8","@Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey":"System","@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey":"System","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory":"SystemFailure","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMessageName":"UnExpected","@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode":"400","@Microsoft.PowerApps.CDS.HelpLink":"go.microsoft.com/.../ unsupported attribute name: 'useridname' when converting entity expression to SQL."}}

    I tried to group by callinguserid, operation but it is giving me same exception. It seems grouping is not supported on Audit entity.

    I would suggest you to log ticket with microsoft.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Ravi Fulani Profile Picture
    836 on at

    They are saying to me that this is some customization and in this they cannot help me out, is there any other way by which I can raise issue with them.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Navigate to admin.powerplatform.microsoft.com/ and then support -> submit your ticket/issue.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans