• force_knight
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

Hello,

 

I've created a trigger on Reply (Community) object to capture the changes in the UpVote field. I was hoping that if someone "Likes" a Reply, the trigger will fire, but it does not.

 

 

trigger myReplyTrigger on Reply (after update) {
   for(Reply r : Trigger.new) {
      System.debug('~~~ Logging replies ' + r.UpVotes);
       // do some code here ...
   }
}

 

 

Does anyone know how to capture changes in the UpVote field?

 

Thank you!

Michael

Hi,

I've a trigger which add new jobs successfully (with system.schedule), but when I want to delete a job, the method System.abortJob(id) isn't working (job still scheduled).
Do you know where this problem may come from?

Thank you,

Hi there

Is there a way of aborting a scheduled job that is currently in the 'Waiting' status? I have an Apex controller which is designed to create/update a schedule based on the settings provided by the user (in this case a system administrator). The schedule controls sync between SalesForce and an external web service.

The schedule is recurring on a daily or weekly basis, I have tried using the System.abortJob() method to abort the job but this does nothing. Since I cannot abort the job, I then cannot re-schedule the job with the same name. Scheduling under a new name would soon run into trouble due to limits.

//TEST
schedule = '0 40 */2 * * ?';

if (scheduleId.Value__c != '') {
            List<CronTrigger> ct = [select Id from CronTrigger where Id = :scheduleId.Value__c];
            
            if (ct.size() > 0) {
            	for (CronTrigger c : ct) {
            	system.debug('attempt to abort job');
                system.abortJob(c.Id);
                system.debug('job aborted');
            	}
            }
        }
        
        ScheduledSync sSync = new ScheduledSync();
        String syncResult = system.schedule('Sync', schedule, sSync);
        
        scheduleId.Value__c = syncResult;
        
        update scheduleId;

 
Any help would be greatly appreciated.

Regards
Gaz