+ Start a Discussion
Angela SchloederAngela Schloeder 

Error: Compile Error: expecting an equals sign, found 'record' at line 2 column 20

I'm trying to update the Task Helper record with the Related Event ID and keep getting this error.

Any help would be appreciated.
Thank you,

trigger UpdatedRelatedEventField on Task_Helper__c (before insert, before update) {
    for(Task Helper record: Trigger.new) {
        try {
            record.Related_Event__c = Id.valueOf(record.Related_Event__c);
        } catch(Exception e) {
            
        }
    }
}
Best Answer chosen by Angela Schloeder
Temoc MunozTemoc Munoz
trigger UpdatedRelatedEventField on Task_Helper__c (before insert, before update) {
    for(Task_Helper__c record: Trigger.new) {
        try {
            record.Related_Event__c = Id.valueOf(record.Related_Event__c);
        } catch(Exception e) {
        }
    }
}
Changed to Task_Helper__c

Thanks

All Answers

Temoc MunozTemoc Munoz
trigger UpdatedRelatedEventField on Task_Helper__c (before insert, before update) {
    for(Task_Helper__c record: Trigger.new) {
        try {
            record.Related_Event__c = Id.valueOf(record.Related_Event__c);
        } catch(Exception e) {
        }
    }
}
Changed to Task_Helper__c

Thanks
This was selected as the best answer
Angela SchloederAngela Schloeder
Thank you very much.
Temoc MunozTemoc Munoz
Glad to help!
Angela SchloederAngela Schloeder
Now if it actually did what I need ed it to do, I'd be all set. I'm trying to pull in the ID of the Event that a Task and the Task Helper are created from. The Event ID pulls into the a Task vf page just fine via a trigger into the field 'Related Event'. I also have this field on the Task Helper object, ('Related Event'). Any ideas where I'm going wrong?
Temoc MunozTemoc Munoz
Let me see if I understand:

So, you're unable to get the Related_Event__c id value correct?

If so, how is this field populated on the Visual Force Page? How is the trigger fired?

Thanks