DataGrid - Why does GetChangedLines add a jSON object when there's a FK/dropdown
Question

I have a data gird with a data source having four columns from an aggregate joining two entities.

  1. 1d - long 
  2. CostElement - Int
  3. CostElementName - text
  4. BudgetType - FK, Id  <--join

On the Grid, I have set three columns to appear:

  1. CostElement
  2. CostElementName
  3. BudgetType - FK Id as data, secondary column as text

I am using a data structure so I can use a throwaway attribute of 'ChangeType.'

And I'm using a list variable so that the deserialized jSON can populate this list as shown:


When I use GetChangedLines and then deserialize, I see a jSON string like this, which is coming directly from:
GetChangedLines.ChangedLines.EditedLines

[{"zLU_CostElement":{"Id":1,"CostElementName":"Business Meals","CostElement":67330010,"BudgetType":"1"},"zLU_BudgetType":{"Id":2,"BudgetType":"OpEx"}}]


That's what comes in the deserialze jSON step. But the next step is to append the list of type Entity. And I can see no data is getting sent to the list:



So the question is...

 Why is there an object for the foreign key entity in the jSON? And if that is expected behavior of GetChangedLines, how can I get the jSON to be added to the list variable?



Hi Jason,

Not sure if this still an unsolved problem after 6 days, but if it is :

Can you share a screenprint if the proporties of the deserialize and of the debug data of the deserialize right after executing it.

And also a screenprint of the listAppendAll settings.

Also just for my understanding, in above example the original budget type was 1 and in the test you changed it to 2, right?

So i notice the fk in your entity is not changed yet (still 1), so are you taking that into account later in you BL action, that you are not picking the FK of Costelement but the PK of Budgettips for the update?


Dorine

Also, from your debug screenprint, it looks like you are about to execute the appendAll, not like it is already executed

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.