0
votes

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?

1

1 Answers

0
votes

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 w.r.t 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

enter image description here

<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.