简体   繁体   中英

Dynamics 365 CRM reports

I have created a report in dynamics 365 crm using out of the box report wizard present in crm. The report is cases that are active, resolved or canceled. The report shows case resolution field. However when a resolved case is reactivated and then resolved again then it shows 2 entries for that case in the report. Is there any way possible to show only the latest case resolution in the report?

You get Repeat/twice and may be more Record for a case Reason been Case Resoultion is an Entity in Dynamics and everytime you Resolve a case, Note only Resolve a case you will have a record created for this entity. So if you resolve and reopen and resolve like 10 times you will see entry 10 times into your report.

Now as we have a Background why we get repeat records, how to resolve it?

I belive you are aware of D365 fetchxml Reports with reporting Extensions. If not few links below.

SSRS Report Tutorial

You have option to edit your report in Visual studio wrt Report.

In your report you will have Fetchxml, It should be something like below. Important is created on should be ordered as Desc and fetchxml should be distinct.

Fetchxml as you have probably and it's result

在此处输入图片说明

<fetch>
  <entity name="incident" >
    <attribute name="statuscode" />
    <attribute name="title" />
    <attribute name="statecode" />
    <link-entity name="incidentresolution" from="incidentid" to="incidentid" link-type="outer" alias="Resolution" >
      <attribute name="subject" alias="ResolutionSubject" />
      <attribute name="createdon" alias="Resolutioncreatedon" />
      <order attribute="createdon" descending="true" />
    </link-entity>
  </entity>
</fetch>

Fetchxml you need

<fetch distinct="true" mapping="logical" >
  <entity name="incident" >
    <attribute name="statuscode" />
    <attribute name="title" />
    <attribute name="statecode" />
    <attribute name="incidentid" alias="Id" />
    <link-entity name="incidentresolution" from="incidentid" to="incidentid" link-type="outer" alias="Resolution" >
      <attribute name="subject" />
      <attribute name="activityid" />
    </link-entity>
  </entity>
</fetch>

Now Inside Visual studio you need to hide Row based on your Incident Id, Created on date from resolution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM