Version compare


Hi All,

I want to compare the latest 2 versions of an object and if the data are same , i should delete the previous version. Or if the entire data of an object is same as the latest version no need to update the version . can anybody please help me to achieve this?

Thanks in advance.