Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Facing issue in querry in D365, cant fetch

Posted on by 812

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,960 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 812 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,960 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans