REST create deep entity - commit necessary - bug?

0
I set up a REST service to CRUD some entities. I came across a slight flaw when creating a deep entity:  Take for example “Order”: {                “Title”: “order 1”,                “Date”: “2022-05-23”,                “Positions”: [                               {“Title”: “position 1”,                                “PosNo”: “1”,                               “ArticleId”: “32”,                               “Quantity”: 2},                               {“Title”: “position 2”,                                “PosNo”: “2”,                               “ArticleId”: “12”,                               “Quantity”: 4}                ] }   Order is an entity and Order Position a 1..n relation – Both inherit from a general entity containing the Title property. I have set up the message definitions which contain the relations, I set up a microflow for the creation of Order (REST POST microflow). The microflow works fine for the flat entity Order, it creates the order, but it only creates the title property in the db record. As this property is coming from the super entity. The date and articlenumber etc. are not persisted. No other microflow is called, not even the after create event micoflow of the Position. I’m quiet impressed and happy that the system has the deep entity creation covered. For the missing properties I could find a workaround though: I touch each list object in the POST microflow by a change object activity and commit the changes. Not necessarily on all fields, one commit is sufficient. I’m not sure if this is a glitch or what the right approach would be… Just wanted to give you a heads up, not sure if I should report it as a bug… best wishes Stefan Studio Pro 9.12 features enabled
asked
2 answers
0

Might have something to do with the way your incoming data is formatted, mapped and parsed. Your date is formatted in ISO-8601, but Mx doesn’t recognize that pattern out of the box. Same goes for numbers with quotes, the system sees that as a string.

answered
0

Hi again,

Jos was on the right track, I also got help from @Andrej Koelwewijn. In fact the commit was set to ‘off’

I did not pay attention to this setting and couldn’t find it in the mappings. It is set in the body parameter of the POST operation:

answered