Topic by Duncan Taylor
Content
I'm writing a CPM to do audit logging. I would like to be able to write one script which can loop through the object, check what properties have changed and create a log accordingly. However I would like this to work for multiple object types (incidents, cases, contacts, etc.)
I'm aware that the PHP api does lazy loading which has already tripped me up before. However when I iterate through the properties all the values come out as Null. If I assign them to local variables by name it works, but i dont want to have to manually hand code a script for every single object I want to add this too.
Is there a way to loop through all the properties and actually get values out of the api?
PS. I'm aware that I can fetch the object and do it that way, but that means that I dont have access to the previous values available on the passed in object.