+ Start a Discussion

Object Serialization to XML

Hi all,


I am working on a solution where I would like to be able to take a custom object populate it then serialize it to XML to store somewhere - in a field in another object to be exact.


This I usually do in .NET using XML serialization and it works great. I then can at any time deserialize it obviously for later use. Almost like a freeze and defreeze mechanism.


What I really want to do is create another object that will have a text area field where the xml of the serialized object will go and I can retrieve this at any time out of this object to "defreeze" the child object and deserialize it back into memory.


In .NET this is really easy to do. But in APEX is this possible at all? The ideal will be I will create a trigger on object x and then that trigger will then run an apex class that runs some code that does the serialization. And as u can set "before" and "after" events in triggers then I will be able to maintain the two states on an object right???


Well that's how I vision it as an experienced .NET programmer new to Apex programming.


Any pointers guys? Or if it is even possible?





Message Edited by Shion on 03-05-2009 01:30 PM
Message Edited by Shion on 03-05-2009 01:30 PM
Shion - I'm not sure I fully understand your use case. Can you elaborate? It sounds like you want to make a copy of a record and then store somewhere else temporaily?