A while back I wrote an Apex class to handle opportunity splits. I couldn’t use the Opportunity Splits object because there were splits on three different corporate levels (with one-to-many or many-to-many relationships and security on each level). I ended up creating five different custom objects to fulfill a bunch of different reporting requirements, and I used jQuery on the VisualForce page to update various values as the user enters the data. This system has worked well for five years.
However, for some reason I’ve recently started questioning my methodology for performing updates. Because the number of splits and the split recipients can change each time the opportunity is updated, I simply delete all of the associated records on three of the custom objects and replace them with newly created records. That way I don’t have to evaluate each record to see if it needs to be updated, deleted, or a new one created. There is no requirement for an audit trail.
Is this an acceptable methodology?
I apologize if this is the wrong forum to be asking such a broad question, but I figured that I could keep my question shorter by not having to explain the peculiar constraints of Salesforce — I might have chosen a different update strategy under other circumstances.