1

Yesterday I updated the DocuSign Template ID on a previously successful custom button and began receiving the error message below. So I changed the Template ID back to the original value and continue to receive the same error.

Thoughts on what might be going on?

Error Message:
"Apex CPU time limit exceeded Error is in expression '{!CreateEnvelopeRecord}' in component in page dsfs:docusign_createenvelope: (dsfs)"

Button Code:

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 
//********* Option Declarations (Do not modify )*********// 
var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';var CCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';var  CES='';var STB='';var SSB='';var SES='';var SEM='';var SRS='';var SCS ='';var RES=''; 
//*************************************************// 
// Modify individual options here: 
// DocuSign Template ID (default no template) 
DST = '5FA61634-AA13-4BCB-B02A-521B19C3DFB4'; //Ex: '67870A79-A0B5-4596-8AC1-CC7CC1EA01EB' 
// Load Attachments (default on) 
LA = ''; //Ex: '0' 
// Custom Email Message (default in config) 
CEM = 'Thank you for doing business with XOJet, here is the agreement for your signature.' ; //Ex: 'Envelope sent by [FirstName] [LastName] ([Email])!' 
// Custom Email Subject (default in config) 
CES = 'XOJet agreement for signature'; //Ex: 'Re: Opportunity Name: {!Opportunity.Name}' 
// Show Tag Button (default in config) 
STB = ''; //Ex: '1' 
// Show Send Button (default in config) 
SSB = ''; //Ex: '1' 
// Show Email Message (default in config) 
SEM = ''; //Ex: '1' 
// Show Reminder/Expire (default in config) 
SRS = ''; //Ex: '1' 
// Show Chatter (default in config) 
SCS = ''; //Ex: '1' 
// Reminder and Expiration Settings 
RES = ''; //Ex: '0,1,2,0,120,3' 
//********* Page Callout (Do not modify) *********// 
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Opportunity.Id}&RC="+RC+"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+"&CCRM="+CCRM+"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO+"&DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES+"&SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES+"&SEM="+SEM+"&SRS="+SRS+"&SCS="+SCS+"&RES="+RES; 
//*******************************************//

2 Answers2

0

Is this a managed package, or your own page? The page is taking too long to run and exceeds the governor limit (from Salesforce). If it is your own page then check your code (specifically look for loops to eliminate).

If it is managed you will probably need to file a ticket.

Salesforce limits doc: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

raffters
  • 196
  • 4
  • Thanks for responding Raffters! Docusign for Salesforce is a managed package. The custom button is a feature within Salesforce. I'm trying to get the code right for a button on the Opportunity. – user3356379 Apr 10 '15 at 06:55
0

I'm still not sure what's going on, but I may have a new clue. I found the code below in another discussion at DocuSign for Salesforce.com

What's curious is that if I use the code below I will no longer get the "Time Limit" error. HOWEVER, it breaks when I replace the Custom Envelop ID to the one I"m using. Same "Time Limit" error.

I downloaded the XML again or the template to double-check the ID and it's correct. I know virtually zip about code and an API's so I'm baffled.

Thoughts?

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 

//********* Option Declarations (Do not modify )*********// 
var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';var CCTM='';var CCNM='';var CRCL=''; var CRL='';var OCO='';var DST='';var LA='';var CEM='';var CES='';var STB='';var SSB='';var SES='';var SEM='';var SRS='';var SCS ='';var RES='';
 //*************************************************// 

//DocuSign Template 
var DST=''; 
//Adding Notes & Attachments 
var LA='1'; 
//Custom Recipient List 
var CRL='Email~johnsemail@outlook.com;FirstName~user;LastName~1;Role~Signer 1;RoutingOrder~1,Email~janesemail@outlook.com;LastName~user2;Role~Signer 2;RoutingOrder~2,LoadDefaultContacts~1';
 //Custom Contact Role Map 
var CCRM='Signer 1~Customer;Signer 2~SalesRep'; 
//Custom Contact Type Map 
var CCTM='Signer 1~Signer;Signer 2~Signer'; 
//Custom Email Subject 
var CES='Please eSign Vocus Sales Agreement'; 
//Custom Email Message 
var CEM='I am sending you this request for your electronic signature, please review and electronically sign by following the link below.';
 //Custom Envelop from Docusign 
var DST = '7C350ABB-74F9-463E-96E3-49153AA25607'; 


//********* Page Callout (Do not modify) *********// 
window.location.href ="/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Opportunity.Id}&RC="+RC+"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+"&CCRM="+CCRM+"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO+"&DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES+"&SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES+"&SEM="+SEM+"&SRS="+SRS+"&SCS="+SCS+"&RES="+RES;
 //*******************************************//
Community
  • 1
  • 1