• JakeInTheBoxSLC
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi All,

I'm having difficulty figuring out how to test my trigger so that I can put it in my production environment. My trigger is simple and checks to see if a field has been changed and if so it updates another field with the current date and time like so:

trigger PIFDateUpdate on Account bulk (before update) {
for (Account an : Trigger.new) {for (Account ao : Trigger.old) {
if (an.PIF_Available_Balance__c ao.PIF_Available_Balance__c) {
an.As_of_2__c = System.Now();
}
}
}
}

However, I can't figure out how to get 75% test coverage for this. Any thoughts?
Hi All,

I'm having difficulty figuring out how to test my trigger so that I can put it in my production environment. My trigger is simple and checks to see if a field has been changed and if so it updates another field with the current date and time like so:

trigger PIFDateUpdate on Account bulk (before update) {
for (Account an : Trigger.new) {for (Account ao : Trigger.old) {
if (an.PIF_Available_Balance__c ao.PIF_Available_Balance__c) {
an.As_of_2__c = System.Now();
}
}
}
}

However, I can't figure out how to get 75% test coverage for this. Any thoughts?