Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using AgreementTemplateServiceBatch from Trigger

New Here ,
Dec 05, 2018 Dec 05, 2018

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?

444
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation