dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #44203
Re: Saving an enrollment
Hi Apoorv,
Don't use master branch since it is in refactoring stage. For building apps
right now, use the branches *legacy-2.22 , legacy-2.21 *or
*legacy-2.20 *depending
on which version of DHIS you're targeting. If you've cloned the DHIS
Android SDK through git, you can write git checkout <branch name> through
your git shell
Regards,
Erling
On Sat, Mar 26, 2016 at 1:20 PM, Apoorv Patel <patelapoorv9990@xxxxxxxxx>
wrote:
> Hi,
>
> I am using the Master branch sdk for developing Emmunify Android app. I
> am trying to save an enrollment but it gives me an error when I try to
> save it. Following is the code:
>
> Enrollment enrollment = new Enrollment();
> enrollment.setProgram("Child Registration");
> enrollment.setOrgUnit("Vaccine Organization");
> enrollment.setDateOfEnrollment(new DateTime());
> enrollment.setDateOfIncident(new DateTime());
>
> TrackedEntityAttributeValue firstName = new
> TrackedEntityAttributeValue();
> firstName.setTrackedEntityAttributeUId("s2rNdsWsnQc");
> firstName.setValue("Maitri";
>
> TrackedEntityAttributeValue lastName = new
> TrackedEntityAttributeValue();
> lastName.setTrackedEntityAttributeUId("tnxpai82lGX");
> lastName.setValue("Patel");
>
> List<TrackedEntityAttributeValue> values = new
> ArrayList<>();
> values.add(firstName);
> values.add(lastName);
>
> enrollment.setTrackedEntityAttributeValues(values);
>
> Now when I try to save it I get the following error
>
> Unsupported type: class
> org.hisp.dhis.client.sdk.models.enrollment.Enrollment
>
> Are enrollments are supposed to be save in some other manner?
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
>
References