I am trying to create an instance of Document by formatting an object message. Document has a many-to-many relationship with Entity, and at least one Entity is required. If I create a message, an_entity, with an object mapping to entity and externalId as a key value, then I am able to use (format-message (message (: :class “an_entity”) (: externalId “12345”))) to effectively “read” the existing entity with the given ID.
However, what I need is slightly more complicated. I need to create a new Document object, with new EntityParticipation associations, to existing Entity objects. I create an object message to attempt to do this, but (based on the logs) it appears to be trying to create new Entity objects along with everything else. I clear the “create if missing” box on the Entity part of the object message, but this has no effect.
How can I create a new Document object, associated with a new EntityParticipation (the many-to-many link), associated with an existing Entity, using an object message?