ICreateBatch Set Association

5
How will I go about setting an object's association field when using Batch create in a Java action? I am passing through the parent entity as a parameter and then I am trying this : batch.setMemberValue(someEntity.MemberNames.someEntity_associationEntity.toString(), this.associatedEntity); I am getting an exception though : Caused by: com.mendix.core.CoreException: java.lang.IllegalArgumentException: The given value 'otherModule.proxies.associationEntity@b73d420f' with type 'class otherModule.proxies.associationEntity' is not of the same type as the member corresponding with the given member name 'module.someEntity_associationEntity'
asked
1 answers
5

You need to pass the ID, not the object itself into the member, thus:

this.associatedEntity.getMendixObject().getId();

(don't forget to null check first)

answered