Change object should not be null

0
Hi to everyone. I have two entites connected with an 1-1 assotiation: “Motor_E1”->”Motor_iE1” (holds more information concerning “Motor_E1”).  In one Microflow, when I create and commit an object of “Motor_E1”, I also create and commit an object of ”Motor_iE1” (and fill its attributes with zeros).  Then, in another microflow I first retrieve that object (”Motor_iE1”)  “by assotiation” and when I try to change it (just one attribute of it), I get an error:  Change object 'Motor_iE1' should not be null. How can it be null when it has already been created and exists?
asked
7 answers
2

Heey Nick,

While creating the object of Motor_iE1 do you also set the association to the object of Motor_E1? It looks to me that the objects are created but the association between the objects is not being set.

Kind regards,

Edo

answered
2

So your domain model looks something like this:

Then your create flow will look something like this:

and in the create of NewMotor__iE1 to associate it with NewMotor it wil look like this:

In the create you press new and then in the member selection you pick the association to Motor_E1 and as value you set the Motor_E1 you created before this create.

Hope i am clear enough with this :)

answered
0

It looks like the Retrieve hasn’t found anything.

Add a breakpoint at the Retrieve and inspect the variables. It will help you see what is going on.

It’s best practice to always check you have an entity returned before trying to undertake any actions on it. 
 

answered
0

here: 

answered
0

screenshot: 

answered
0

I have cllicked on Entity “Motor_iE1” in the domain model (assotiation has just Multiplicity and On delete) and here is the type: 

answered
0

here:

answered