Hello Community,
I have this doubt,
I have this entity 'Person' in NW Gateway, with:
Id (PK)
FirstName
LastName
And 'Relationship':
Person1Id (PK)
Person2Id(PK)
ValidFrom
ValidTo
/Person1 (Association by Person1Id)
/Person2 (Association by Person2Id)
I create a new person with ODataModel.createEntry(/People, { FirstName : "Juan", LastName : "Duran" });
But, what if I want to create a new 'Relationship' and two 'Person's INLINEd?
Something like:
var oContext = ODataModel.createEntry(/People, { FirstName : "Juan", LastName : "Duran" });
ODataModel.createEntry('Relationships', { Person1: { FirstName : "Martha", LastName : "Argerich", Person2 : oContext.getObject() } });
What I want to do, is associate two newly created Entries, and submit my changes and send the payload ONLY to /Relationships?
What's the better practice?
Thank you