afawcett / apex-sobjectdataloader

A generic native SObject data loader implementation using Apex JSON support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong serialization order makes deserialize fail

rsoesemann opened this issue · comments

Context

I have the following data structure with a 4 related objects. Process as the common parent and Stage, Decision and Assignment as child records.

There are 2 more relationships:

  • Stage has a lookup to Decision
  • Assignment has a lookup to Stage

bildschirmfoto 2017-10-06 um 19 09 31

Problem

When I serialize this the RecordBundles have this incorrect order:

  1. Process
  2. Stage
  3. Decision
  4. Assignment

although they should have this correct order:

  1. Process
  2. Decision
  3. Stage
  4. Assignment

This JSON cannot be deserialized correctly.