• Ed SFDCDeveloper
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
I am trying to create a trigger that will count activities (tasks) on leads.
My code is below....

When saving I am getting the following error....

Error: Compile Error: unexpected token: '}' at line 30 column 1

But if I remove the curly bracket I get a different error

Error: Compile Error: unexpected token: '<EOF>' at line 30 column 0

trigger TaskUpdateLead on Task (after delete, after insert, after undelete, after update)
Set<ID> LeadIds = new Set<ID>();

//We only care about tasks linked to Leads.

String leadPrefix = Lead.SObjectType.getDescribe().getKeyPrefix();

//Add any Lead ids coming from the new data

if (Trigger.new != null) {
    for (Task t : Trigger.new) {
     if (t.WhatId != null && string.valueOf(t.whatId).startsWith(leadprefix) )
//Also add any Lead ids coming from the old data (deletes, moving an activity from one Lead to another)

if (Trigger.old != null) {
    for (Task t : Trigger.old) {
     if (t.WhatId != null && String.valueOf(t.whatId).startsWith(leadprefix) )
         { LeadIds.add(t.whatId);
if (LeadIds.size() > 0)


Any guidance is very much appreciated.



I am using the data loader command line tool to extract data out. For one object, I only want to extract data that meets certain criteria. How do I specifiy a string value in the sfdc.entity field? 


$JAVA_HOME/jre/bin/java -cp $FILE_BASEDIR/DataLoader.jar \
-Djava.io.tmpdir=$LOGDIR -Dsalesforce.config.dir=$FILE_BASEDIR/config \
com.salesforce.dataloader.process.ProcessRunner process.name=extract \
process.lastRunOutputDirectory=$LOGDIR \
process.statusOutputDirectory=$LOGDIR \
dataAccess.name=$DATADIR/$STAMPFOLDER/57_Standard_kav_01.csv \
sfdc.entity=Standard__kav \
sfdc.extractionSOQL="select ID,Title,Summary from Standard__kav where PublishStatus=\'Online\'"


I am gettingan empty query error


2012-02-14 15:38:54,306 ERROR [extract] action.ExtractAction getColumnsFromSoql (ExtractAction.java:235) - Error in query: query is empty
2012-02-14 15:38:54,307 ERROR [extract] progress.NihilistProgressAdapter doneError (NihilistProgressAdapter.java:51) - Error in query: query is empty

I was able to extract data with the same set up for those that don';t have the where clause.


Does anyone know how to escape the string value in the where clause?