Skip to main content
jeffreyk26143061
New Participant
December 5, 2018
Question

Using AgreementTemplateServiceBatch from Trigger

  • December 5, 2018
  • 0 replies
  • 535 views

Hi all,

I'm trying to use the AgreementTemplateServiceBatch from a trigger context, and the resulting batches are failing with the following errors:

First error: Future method cannot be called from a future or batch method: echosign_dev1.AgreementTemplateProcessor.autoSend(Id)

The relevant part of the trigger code is essentially this:

echosign_dev1.AgreementTemplateServiceBatch batch = new echosign_dev1.AgreementTemplateServiceBatch(recordIDsToSendForSignature, agreementTemplateId, 'My_Object__c');

string syncProcessId = Database.executeBatch(batch, 5);

The agreement templates are configured to Auto-Send. Is this the appropriate way to generate and send Agreements from Agreement Templates from a trigger?

Without knowing the internals of the adobe package, it seems like this could be solved if AgreementTemplateServiceBatch implemented the Database.AllowsCallouts interface like so:

global class AgreementTemplateServiceBatch implements Database.Batchable<sObject>,   Database.AllowsCallouts { ... }

But perhaps I'm using the wrong service or there's a configuration that may allow this?

    This topic has been closed for replies.