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

Send agreements via Apex code (Salesforce integration) - Invalid or no file info is provided

New Here ,
Oct 18, 2021 Oct 18, 2021

Copy link to clipboard

Copied

Sample Code - 

//Inserting the Agreement

echosign_dev1__SIGN_Agreement__c a = new echosign_dev1__SIGN_Agreement__c ();
a.Name = 'Test agreement 6'+system.now();
a.echosign_dev1__Message__c = 'ABCD';
a.echosign_dev1__Recipient__c = '0030o00003ZwbtnAAB';
a.echosign_dev1__SignatureOrder__c = 'Recipient signs, then I sign';
a.echosign_dev1__SignatureType__c = 'e-Signature';
a.echosign_dev1__Signature_Flow__c = 'Order Entered';
a.echosign_dev1__SenderSigns__c = true;
a.echosign_dev1__Recipient_Addresses__c = 'xxxxxxxxxxxxxxxxx@gmail.com,';

insert a;

 

/*Taking file from an Agreement which sent the e-mail successfully to recipients, and creating a new content document link to the agreement (I am able to see the file in the Agreement record, when I navigate to it on the UI) */
ContentDocumentLink cd = new ContentDocumentLink();
cd.LinkedEntityId = a.Id;
cd.ContentDocumentId = '0690o00000ObZAcAAN';
cd.visibility = 'AllUsers';
insert cd;

 

//Inserting the recipients

Echosign_Dev1__SIGN_Recipients__c asdasd = new Echosign_Dev1__SIGN_Recipients__c();
asdasd.echosign_dev1__Agreement__c = a.Id;
asdasd.echosign_dev1__Contact__c = '0030o00003ZwbtnAAB';
asdasd.echosign_dev1__Recipient_Role__c = 'Signer';
asdasd.echosign_dev1__Recipient_Type__c = 'Contact';
asdasd.echosign_dev1__Order_Number__c = 1;

insert asdasd;

 

//And as a last step I am calling the "echosign_dev1.EchoSignApiService.SendDocumentResult" method and passing the agreement Id as the parameter. 

 

But I am getting the error - 

But I am getting the error - 'Invalid or no file info is provided.'  on the field - echosign_dev1__ErrorMessage__c on Agreement object.

 

Can you please help with the same/or let me know if I'm missing something?

TOPICS
Send documents , SharePoint and Salesforce integration

Views

3.6K

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Employee , Oct 18, 2021 Oct 18, 2021

you want to make use of the agreement template service to create agreements using the agreement template record.

See 

https://helpx.adobe.com/sign/using/salesforce-integration-developer-guide.html

and for a primer on using the template rcord see

https://community.adobe.com/t5/adobe-sign-discussions/sending-adobe-sign-agreements-from-custom-objects-in-salesforce/m-p/5885031

Votes

Translate

Translate
Adobe Employee ,
Oct 18, 2021 Oct 18, 2021

Copy link to clipboard

Copied

you want to make use of the agreement template service to create agreements using the agreement template record.

See 

https://helpx.adobe.com/sign/using/salesforce-integration-developer-guide.html

and for a primer on using the template rcord see

https://community.adobe.com/t5/adobe-sign-discussions/sending-adobe-sign-agreements-from-custom-obje...

Votes

Translate

Translate

Report

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
New Here ,
Jan 14, 2022 Jan 14, 2022

Copy link to clipboard

Copied

Hello, did you manage to get your code working? I'm having the same issue and my code is very similiar to yours.

Votes

Translate

Translate

Report

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
New Here ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied

Like mentioned in the previous comment. Started using agreement templates. Let me know if you need more insights to what I've tried to implement.

Votes

Translate

Translate

Report

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
New Here ,
Jan 17, 2022 Jan 17, 2022

Copy link to clipboard

Copied

Hi, thanks for your message. 

Yes, I'd like help using templates. I just need to automatically send a PDF linked to an opportunity to sign. Why do I need a template?

Votes

Translate

Translate

Report

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
New Here ,
Apr 09, 2022 Apr 09, 2022

Copy link to clipboard

Copied

Hi,

 

I am in the same situation and do not want to use the template as the document generated using templates is not to our users liking..

So we have the document created but I am getting the above error when calling the "echosign_dev1.EchoSignApiService.SendDocumentResult" method.

 

Was anyone able to send it calling the method ?

Votes

Translate

Translate

Report

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
New Here ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Could you please elaborate on how did you achieve the same results by using Agreement Templates? 

 

I am trying to achieve something similar where i am creating an agreement, attaching a file and then trying to send the agreement using background action but i receieve the same error as you have specified above.

Votes

Translate

Translate

Report

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
New Here ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

Hi,

 

Did anybody find a proper solution to this. I am getting the same issue when I try to attach the file to the template programatically. When I attach the file via the UI it works so it makes me believe this is not a problem with the templates but the ContentDocument/ContentDocumentLink

Votes

Translate

Translate

Report

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
New Here ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

We went the template way using a flow..

1. Create a Agreement Template record with name, message, auto send and auto reminder fields set. 

2. Create the Add File Attachment record(s) with the Attachment Document Id's (ContentVersion Id), Attachment Documents(Name), Index, Attachment Source Type, Attachment Type and Agreement Template(Id from step 1).

3. Create the Add Recipient record(s) with Index, Recipient Role, Recipient Type, Signer Verification, source of Recipient, Email(or Contact/Lead Id) and Agreement Template(Id from step 1).

4. Call the Apex Action "Load Agreement Template" and pass the Agreement Template(Id from step 1).

 

Let me know if there are any questions with the above.

Votes

Translate

Translate

Report

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
New Here ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

I was able to get it working!

Votes

Translate

Translate

Report

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
Community Beginner ,
Nov 24, 2023 Nov 24, 2023

Copy link to clipboard

Copied

@defaultlzg6iw5x34n7 can you please lay down the steps how did u managed to make it work. I am using 

AgreementTemplateService.load and passing the template record Id and MasterObjectId , but the issue is it working fine only for the first record and for other records (Master Record) it is creating agreement record with status as Draft and error on the agreement record is no file attached , sometimes there is no recepients on the agreement record 

Votes

Translate

Translate

Report

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
Adobe Employee ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

Hi Abhi337095073ozj,

 

Thank you for reaching out.

 

We have checked that you are using the Adobe Sign Enterprise plan. If you have an integration-related question, the experts can best answer it. Please contact our Adobe Sign Enterprise support team for the correct information. You may contact them using the steps in the following help document: https://helpx.adobe.com/sign/using/adobesign-support-resources.html.

Refer to the following help document for more information on Acrobat Sign Integration: https://helpx.adobe.com/sign/integrations/home.html.

 

Thanks,

Meenakshi

Votes

Translate

Translate

Report

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
Community Beginner ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

LATEST

Your code seems to be missing a crucial step: telling Adobe eSign what document to send with the agreement. The error message "Invalid or no file info is provided" indicates this.

Here's the likely culprit:

  • Missing Attachment: While you link a document using ContentDocumentLink, Adobe eSign might require the document to be directly attached to the agreement record itself.

Solution:

Explore Salesforce Apex methods for attaching files to records (e.g., Attachment API). Attach the document to the agreement record before attempting to send it with Adobe eSign.


Here's how you can potentially modify your code to address these issues:

//Inserting the Agreement
echosign_dev1__SIGN_Agreement__c a = new echosign_dev1__SIGN_Agreement__c ();
a.Name = 'Test agreement 6'+system.now();
a.echosign_dev1__Message__c = 'ABCD';
a.echosign_dev1__Recipient__c = '0030o00003ZwbtnAAB';
a.echosign_dev1__SignatureOrder__c = 'Recipient signs, then I sign';
a.echosign_dev1__SignatureType__c = 'e-Signature';
a.echosign_dev1__Signature_Flow__c = 'Order Entered';
a.echosign_dev1__SenderSigns__c = true;
a.echosign_dev1__Recipient_Addresses__c = 'xxxxxxxxxxxxxxxxx@gmail.com,';

insert a;

// Link the Agreement to the ContentDocument (assuming you have a method to get the correct ID)
ContentDocumentLink cd = linkAgreementToDocument(a.Id);

if (cd == null || cd.Id == null) {
// Handle error - ContentDocumentLink failed
System.debug('Error linking ContentDocument to Agreement: ');
return; // Or throw an exception
}

// Now that the link is established, proceed with recipient insertion etc.

/*Taking file from an Agreement which sent the e-mail successfully to recipients, and creating a new content document link to the agreement (I am able to see the file in the Agreement record, when I navigate to it on the UI) */
// (Rest of your code remains the same)

 

Votes

Translate

Translate

Report

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