• David Okner 17
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi all,
writing my first trigger and can't seem to get it to work, can you take a look and see what I am doing wrong? Should it be after insert, before update?
It's just not putting the test text in the custom field...
What i am trying to do is eventually put a template in the description field for my users to fill out.
Thanks!

trigger insertText on Case (before insert, before update) {

            for (case c : trigger.new) {
            
                        If (c.triggertest__c == null)
                                    c.triggertest__c = 'Text here';

                        else {
                                    System.debug ('field is already filled in');
                        }
           
            }
}