• kumar Sanu 8
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

Hi ,
My Batch class is not saving and giving m ethe follow errors need help please

Error1: Compile Error: S2S_PropogateParent: Class must implement the global interface method: Iterable<SObject> start(Database.BatchableContext) from Database.Batchable<SObject>,

Error 2 :S2S_PropogateParent: Class must implement the global interface method: void execute(Database.BatchableContext, LIST<SObject>) from Database.Batchable<SObject>,

Error 3 : S2S_PropogateParent: Class must implement the global interface method: void finish(Database.BatchableContext) from Database.Batchable<SObject> at line 1 column 14

global class S2S_PropogateParent implements Database.Batchable<sObject>  {

  global void execute(SchedulableContext SC) {

    S2S_Utils su = new S2S_Utils();

    // clear out previously completed records
    Datetime hourAgo = DateTime.now().addHours(-1);
    List<S2SParentPropogation__c> deleteNow = [SELECT Id FROM S2SParentPropogation__c WHERE Status__c = 'Completed' AND CreatedDate < :hourAgo];
    try {
      delete deleteNow;
    } catch (Exception e) {
      // meh, it was probably already deleted by another job running in parallel
    }

    /****************** Retrieve Data **********************/
    // what records are out there awaiting sync
    Datetime minsAgo = DateTime.now().addMinutes(-1);
    List<S2SParentPropogation__c> processNow =
      [SELECT LocalId__c, LocalAccountId__c, Status__c
      FROM S2SParentPropogation__c
      WHERE Status__c = 'Inserted'
      AND (JobID__c = 'DOH-testing' OR CreatedDate < :minsAgo)];

    // get list of accounts so we know which sync records to look for
    List<ID> localAccountIds = new List<ID>();
    for (S2SParentPropogation__c pp : processNow) {
      localAccountIds.add(pp.LocalAccountId__c);
    }

    // which of those accounts have completed sync?
    List<PartnerNetworkRecordConnection> findSynchedAccounts = su.findAlreadySynchedAccounts(localAccountIds);

    /****************** Add Sync Records **********************/
    List<PartnerNetworkRecordConnection> newSynchRecords = new List<PartnerNetworkRecordConnection>();
    for (S2SParentPropogation__c p : processNow) {

      // find corresponding account S2S sync record
      PartnerNetworkRecordConnection accountS2S = null;
      for (PartnerNetworkRecordConnection pn : findSynchedAccounts) {
        if (pn.LocalRecordId == p.localAccountId__c) {
          accountS2S = pn;
        }
      }

      // found it
      if (accountS2S != null) {
        // auto-share this contact/opportunity with the client org
        newSynchRecords.add(su.buildPartnerConnectionRecord(p.LocalId__c, p.LocalAccountId__c));
        p.Status__c = 'Completed';
      }
    }

    insert newSynchRecords;
    update processNow;

  }

}

-------------------------------------------------------------
If i replace the first line with global class S2S_PropogateParent implements Schedulable { but if i use this i cannot schedule the batch class as it throws me an error Argument must be an object that implements Database.Batchable

Thanks
Akhil
  • February 27, 2014
  • Like
  • 0

Hi everyone.

 

Has anyone attempted to display a dashboard as part of a visualforce page? I have been browsing around and haven't found anything. The reason I ask is that I want to show one of our dashboards on our company's intranet websites, and figured the easiest way to do it would be to display it in visualforce and publish it as a Site that the intranet web could then incorporate into it's layout.

 

If anyone has any hints or tips I'm all ears :)

 

Regards,

Ivar