Skip to main content
Dynamics 365 general forum
Suggested answer

Facing issue in querry in D365, cant fetch

editSubscribe (0) ShareShare
ReportReport
Posted on by 810

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
    Bipin D365 28,934 Super User 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
    Ravi Fulani 810 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
    Bipin D365 28,934 Super User 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/

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Sundar…

Industry experts answer burning questions directly from our amazing Community…

Enabling Copilot Case and Conversation…

Agents can easily recap an ongoing chat, transcribe a voice conversation…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 282,978 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans