← Back to team overview

dhis2-devs team mailing list archive

Not able to get enrollments for Tracked Entity Instance

 

Hi,

I am trying to get enrollments from the server based on certain attribute
values. For that I am doing the following steps:

1) I am using

TrackerController.queryTrackedEntityInstancesDataFromServer

to get tracked entity instances that have a certain tracked entity
attribute value.


2) After getting the list of tracked entity instances I am using

TrackerController.getTrackedEntityInstancesDataFromServer(DhisController.getInstance().getDhisApi(),
instances, true);

to get the tracked entity instances and their corresponding
enrollments from the server.


3) However when I use

TrackerController.getEnrollments

I get an empty list although the enrollment exists on the server.


The list that I obtain in the first step has one element so there
exists at least one TEI which has enrollments which satisfy my
mentioned query, but I don't get anything in the enrollments.

Do I need to change anything in my approach to get the enrollments?


Thanks,

Apoorv Patel

Follow ups