openedge write-json how to add object
You can load the datasets's JSON into a JSON object first:
At the top of your program (first statement):
USING Progress.Json.ObjectModel.* FROM PROPATH.
DEFINE VARIABLE oJsonObject AS JsonObject NO-UNDO .
DEFINE VARIABLE oJsonObject2 AS JsonObject NO-UNDO .
and instead of your dsOrd:WRITE-JSON
oJsonObject = NEW JsonObject () .
dataset dsOrd:write-json("JsonObject", oJsonObject, true).
oJsonObject2 = NEW JsonObject () .
oJsonObject2:Add ("event_type", "LOAD_AVAILABLE") .
oJsonObject2:Add ("event_data", oJsonObject:GetJsonObject ("event_data") .
oJsonObject2:WriteFile(dFileName, TRUE) .