• Anthony Wheeler
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have three fields on a custom object:
  1. Enrollment Status(Picklist)
  2. Enrollment Status Reason(Picklist)
  3. Opt Out Date(Date)
and two workflow rules that run on them. The first one sets the Enrollment Status to a value of "Not Enrolled" when the Enrollment Status Reason is changed to equal one of its corresponding reasons. The second one populates the Opt Out Date with today's date when the Enrollment Status field is changed to a value of "Not Enrolled". This works perfectly in the sandbox, but in production, the Opt Out Date only fills in when another random field changes value. The Enrollment Status is filled with "Not Enrolled" regardless. The workflows are identical in the sandbox and in production. I have looked over the debug logs, and it looks like the first rule evaluates to true, and the second rule evaluates to false imediately after. But in the logs where the date was filled in correctly, it looks like the second workflow was evaluated twice. Not sure why this is. I don't want to combine the workflows, because we also want to be able to modify the Opt Out Date manually, and it gets overcomplicated quickly when they're combined. Any help on this would be much appreciated. 
I'm trying to write a trigger that tests if a custom field on a User record changes after the record is updated. In my test class, before the update, the field is assigned to null. It is then populated and updated, but in the trigger, Trigger.old and Trigger.new are returning the updated field. I have verified this through the debug log. Not sure why this is happening. 
I have three fields on a custom object:
  1. Enrollment Status(Picklist)
  2. Enrollment Status Reason(Picklist)
  3. Opt Out Date(Date)
and two workflow rules that run on them. The first one sets the Enrollment Status to a value of "Not Enrolled" when the Enrollment Status Reason is changed to equal one of its corresponding reasons. The second one populates the Opt Out Date with today's date when the Enrollment Status field is changed to a value of "Not Enrolled". This works perfectly in the sandbox, but in production, the Opt Out Date only fills in when another random field changes value. The Enrollment Status is filled with "Not Enrolled" regardless. The workflows are identical in the sandbox and in production. I have looked over the debug logs, and it looks like the first rule evaluates to true, and the second rule evaluates to false imediately after. But in the logs where the date was filled in correctly, it looks like the second workflow was evaluated twice. Not sure why this is. I don't want to combine the workflows, because we also want to be able to modify the Opt Out Date manually, and it gets overcomplicated quickly when they're combined. Any help on this would be much appreciated. 
I'm trying to write a trigger that tests if a custom field on a User record changes after the record is updated. In my test class, before the update, the field is assigned to null. It is then populated and updated, but in the trigger, Trigger.old and Trigger.new are returning the updated field. I have verified this through the debug log. Not sure why this is happening.