go to post Lukasz Migacz · Apr 10 I did something similar by saving OBX segments in %Library.ListOfObjects %Library.ListOfObjects - InterSystems Supply Chain Orchestrator 2024.1 - including private class members I would say: Create an empty OBX segment object Use iterator "i" to Iterate over all the OBXs in the source message OBX group while checking if OBX:5 contains "Total" string, If yes, save an index of this OBX in a list/array %ArrayOfDataTypes = IndexList, and increase the iterator "i" by 1 At the same time copy each OBX segment from a source message as a segment object in a list of objects, use %Library.ListOfObjects = ObjectsList at the index "i". When all OBXes are copied across, then use InsertAt() to insert empty OBX segments into ObjectsList, where index matches the index fromIndexList. Keep in mind the index "i" shifted by one each time "Total" string was found Create an empty target message, copy PID, ORC, OBR segments across from the source message Iterate over %Library.ListOfObjects , extracting OBX segments and copying them to the new target messgae. Let me know how it went. :)
go to post Lukasz Migacz · Mar 6, 2024 The problem has been resolved by adding an argument to LoadDir. $system.OBJ.LoadDir(directory,"ck/multicompile=0")