CPM access object properties with loop
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.