on 02-02-2021 1:59 PM
Hi experts,
a question that I have seen pop up a couple of times, but I couldn't find a satisfying solution.
I have 2 entity types:
and I have the following entities:
ContractSet('A'): {
Id: "A",
ProjId: "X"
}
ProjectSet('X'):
{
ProjId2: "X",
SomeProp: "1" }
ProjectSet('Y'):
{
ProjId2: "Y",
SomeProp: "2"
}
There is an (1:1) association between the two entitypes: Contract.ProjId = Project.ProjId2, with on both sides a navigation property (Project, resp. Contract)
I want to select a different project for the contract (in the frontend, without updating the data in the backend).
I now execute:
oModel.setProperty("/ContractSet('A')/ProjId","Y");
let sProjId = oModel.getProperty("/ProjectSet('X')/ProjId2");
the value of sProjId is now "Y".
In my oModel.oData, I now see 2 instances with the same ProjId2 value.
So /ContractSet('A')/Project still refers to the same Project X. It has simply updated the ProjId property as well as the ProjId2 property of the referred Project. How can I correctly update the /ConstractSet('A')/Project reference to point to the newly selected project Y? (without updating the data in the backend).
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.