You need to sign in to do that
Don't have an account?
Ummang Jain
trigger question
Hey im new to trigger im struck on the question
Create a tracking object which records deletion/ Updation /Addition of student object.(e.g Associated with class, unassociated , Deleted ,Email , Dob , Phone , Name field updated). Record both Old value and New Value.
Create a tracking object which records deletion/ Updation /Addition of student object.(e.g Associated with class, unassociated , Deleted ,Email , Dob , Phone , Name field updated). Record both Old value and New Value.
In summary, this would be an insert, update, and delete trigger. Trigger.New and Trigger.Old contain a list of the old and new objects as well as Trigger.NewMap and Trigger.OldMap -- at least for updates and deletes. For inserts, you only have the new versions for obvious reasons. Therefore, you potentially will want to make use of Trigger.isInsert. Depending on how you are trying to audit the changes (i.e., in one row with all the changes in one column like XML or JSON versus one row per change), you either loop through the list of changes.
I hope that gets you started then please post back specific question, so we can help you learn.
References:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_syntax.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_context_variables.htm