Home Forums Integration Messages Format an object message to create a new object associated to existing objects?

Viewing 1 reply thread
  • Author
    Posts
    • #10243
      Louis PaceLouis Pace
      Participant

      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?

      0
    • #10255
      Louis PaceLouis Pace
      Participant

      Timothy Lee found the solution to this. In the object mapping for the existing objects — Entity, in this case — set local=false.

      0
Viewing 1 reply thread
  • You must be logged in to reply to this topic.