0

There are a lot of comments on a ticket in my system. Ticket and comment are in separate entities. There is a field name modifyon in the Comment entity to define when the comment created.

How can I get just latest comment for each ticket?

Example:

1

1 Answer 1

1

We cannot do subquery in fetchxml to get the latest or last modifiedon record from child linked entity.

Normally we will have a flag in child record to identify or keep a lookup of latest record in parent, so its easy to pull/filter/expand whenever need comes.

You can try start querying from the child entity (comments) and inner join the parent case to achieve what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.