Hi all,
Is it possible to create multiple entities with associations in a single LUW.
For e.g. we have a Sales Order and Item. This is modelled as 2 DB tables and 2 entities.
In XSOData I have defined association relationship between them.My XSOData definition is like this...
"XSDemo.DB::SO" as "SalesOrder"
navigates ("SalesOrder_OrderItem" as "SOItem");
"XSDemo.DB::ITEM" as "OrderItem";
association "SalesOrder_OrderItem" principal "SalesOrder"("OrderID") multiplicity "1"
dependent "OrderItem"("OrderID") multiplicity "*";
My post URI is
My data is as follows
{
"ID": 1,
"Customer": 123,
"Desc": "Test SO",
"SOItem": [
{
"Material": "MAT1",
"Qty": "10",
"Item": "10"
},
{
"Material": "MAT2",
"Qty": "20",
"Item": "5"
}
]
}
From the post, I get a response 201 (Created). However, only the Sales Order is created. The Items are not created.
My question is:
1. Is it possible to create Order and Item together in a single post call ?? If yes, how. What is the syntax of XSOData / Post Request
2. If it is not possible to create Order and Item together in a single post call, then how do we ensure atomicity of the transaction.
For e.g. What is Order creation is success and then the Item creation fails ...
How can we ensure that all is committed or none is committed.
3. From the documentation I understand that this might be possible using modification exits... However, I want to achieve this without using modification exits...
Is this possible or not ?