I am working on an integration scenario where records are loaded into an custom object and The custom object is loaded twice due to the fact that data resides in two separate systems.
First customer information is loaded. Assume field1, field2 and
field3 is updated.Second financial information is loaded. This is when the trigger
should fire and do some calculations/aggregations. In this case
field4 is updated.
I don't want the trigger should fire in first case so I am comparing old values and new values of field4 and skipping the triiger logic but in few cases, the old value and new value of field4 is same when I do the second load. It means old value is 10000 and new value is also 10000. It is an update but same value. Since the updated value is same as old value, The check I put is skipping the trigger logic which I don't want.
Is there anyway to skip the triiger logic during first load and just run it during the second load. I thought of creating a flag field and set it to true during first load and check for it in trigger. If true then skip the trigger.
I would like to know If there is any other way to solve this issue without introducing another field.