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 830

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>

  • Suggested answer
    Bipin D365 Profile Picture
    28,961 Moderator on at
    RE: Facing issue in querry in D365, cant fetch

    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/

  • Ravi Fulani Profile Picture
    830 on at
    RE: Facing issue in querry in D365, cant fetch

    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,961 Moderator on at
    RE: Facing issue in querry in D365, cant fetch

    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/

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,140 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans