• Steve101
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

I have a Workflow rule that creates a Task each time a specific type of Lead is created.  I have a custom field in this Task that needs to be populated upon creation but I cannot accomplish this with the Workflow so I am creating a trigger. 

 

I get the following error when I save the trigger

 

Error: Compile Error: unexpected token: '}' at line 5 column 12

 

Here is the trigger

 

trigger PubProductUpdate on Task (before insert){

    for (Task PU : Trigger.new){
        if (PU.RecordTypeId = '012U0000000Z6qBIAS' && PU.Subject = 'Pitch Networks' && PU.Pub_Products__c = null)
            }
    {
    
    PU.Pub_Products__c = 'Pub Opening Pitch';
    }
}

 

I am new to Apex Triggers and not sure where my select criteria goes wrong. 

 

Thanks.

I have a Workflow rule that creates a Task each time a specific type of Lead is created.  I have a custom field in this Task that needs to be populated upon creation but I cannot accomplish this with the Workflow so I am creating a trigger. 

 

I get the following error when I save the trigger

 

Error: Compile Error: unexpected token: '}' at line 5 column 12

 

Here is the trigger

 

trigger PubProductUpdate on Task (before insert){

    for (Task PU : Trigger.new){
        if (PU.RecordTypeId = '012U0000000Z6qBIAS' && PU.Subject = 'Pitch Networks' && PU.Pub_Products__c = null)
            }
    {
    
    PU.Pub_Products__c = 'Pub Opening Pitch';
    }
}

 

I am new to Apex Triggers and not sure where my select criteria goes wrong. 

 

Thanks.