I'm trying to do some actions like calling a class when an only separate set of fields are modified on an object.
What I did
I'm using trigger.old and trigger.new to compare values of old and new for each and every field to call the class. The challenger here is if I need to add one more field to it I need to repush the whole class for adding one field
Why I am not doing through point & click
I can use ISchanged from process and builder and perform the action but I need the old and new values to see history.
What I am trying to do
Create a custom metadatatype with Label and API name and somehow compare this in trigger context to make it scalable.
Where I am stuck
I have added the label and API name to a map and used Schema.SObjectType.Account.fields.getMap() to get Api name , label pair but I am unable to figure out how to compare these.
Any help is much appreciated.