Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

API to Set Custom Tabs

The setTabs API enables you to set initial values for certain fields in the Agreement. The value you set using the setTabs API is displayed on the envelope. Set the initial values using this API before you initiate the eSignature request.

set Tabs for each Recipient: Provides an initial set of corresponding values for each tag type for a recipient when the request is sent to DocuSign. These are the initial values that are viewable and editable in the document you send to the signer for signature.

Before using the APIs ensure the following:

  • Ensure that the DocuSign Custom Classes with the field Add Recipient Tabs Callback Classispopulatedwith the callback class name, DocuSignEnvelopeSetRecipientTabs2Imp.
  • Ensure that you select theRecipientTabs Enabled checkbox under the DocuSign System Properties.
  • In the custom callback class, set the value and the anchor string for the custom tag, getRecipientTabsmethodiswherewe set the value and the anchor string for the custom tag that we want to prepopulate.

In the Custom Callback class, the getRecipientTabs method is where you set the value and the anchor string for the custom tag that you want to prepopulate. So, if you want to populate a text tab with some value, you should initialize the text tab in the getRecipientTabs method such as Apttus_DocuApi.DocuSignUtil.textTab objTextTab = new Apttus_DocuApi.DocuSignUtil.textTab(iRecipientId,'This Value','40','0','0'.The second parameter is the value that you need to set for the custom text tag, so for above example, the text tag has a value - 'This Value', when it shows up in DocuSign. You can set it to a dynamic value by pulling up any field through SOQL using the parentId. Then, while setting the anchor string for the tag, you can define what anchor string you are going to use in the template. Suppose you want to use \t {r}\anchortag, this is what you put in the custom class- objTextTab.anchorString = '\\t'+iRecipientId; objRecipientTabs.addTextTab(objTextTab). You then need to use the tag \t1\, \t2\ in the document that you are sending for signature, and you need to have the tag \t{r} \ defined under the DocuSign account under custom tags.

Note:

We have customized the code as per UseCase 2. You can customize the code below as per your business requirements.

The snippet below enables you to set default values for DocuSign tags.

/*
* Sample class for demonstarting how to set the default values for DocuSign tags 
*/
global class DocuSignEnvelopeSetRecipientTabs2Imp implements Apttus_DocuApi.IDocuSignEnvelopeSetRecipientTabs2{

global List<Apttus_DocuApi.SetRecipientTabsWrapper> listToSetRecipientTabsWrapper = new List<Apttus_DocuApi.SetRecipientTabsWrapper>();
global List<Apttus_DocuApi.SetRecipientTabsWrapper> setRecipientTabs(List<Apttus_DocuApi.SetRecipientTabsWrapper> iListSetRecipientTabsWrapper){
System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 001 ');
this.listToSetRecipientTabsWrapper = iListSetRecipientTabsWrapper;

for(Integer counter = 0 ; counter < listToSetRecipientTabsWrapper.size(); counter++){
Apttus_DocuApi.SetRecipientTabsWrapper objSetRecipientTabsWrapper = this.listToSetRecipientTabsWrapper.get(counter);
this.listToSetRecipientTabsWrapper[counter] = this.addRecipeintTabs(objSetRecipientTabsWrapper);
} 
System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 002 ');
return listToSetRecipientTabsWrapper; 
}

public Apttus_DocuApi.SetRecipientTabsWrapper addRecipeintTabs(Apttus_DocuApi.SetRecipientTabsWrapper iSetRecipientTabsWrapper){

System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 003 '); 
List<Apttus_DocuApi.DocuSignUtil.Recipient> listRecipient = iSetRecipientTabsWrapper.listRecipient;
String parentId = iSetRecipientTabsWrapper.parentId;

for(Integer counter = 0 ; counter < listRecipient.size(); counter++){ 

Apttus_DocuApi.DocuSignUtil.Recipient objRecipient = listRecipient.get(counter);

listRecipient[counter] = this.addRecipeintTab(objRecipient);
} 
System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 004 ');
iSetRecipientTabsWrapper.listRecipient = listRecipient;
return iSetRecipientTabsWrapper; 
}

public Apttus_DocuApi.DocuSignUtil.Recipient addRecipeintTab(Apttus_DocuApi.DocuSignUtil.Recipient iRecipient){
Apttus_DocuApi.DocuSignUtil.Recipient objRecipient = iRecipient;
System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 005 ');
objRecipient.tabs = getRecipientTabs(String.ValueOf(objRecipient.objectIndex+1));

return objRecipient;
}


public Apttus_DocuApi.DocuSignUtil.RecipientTabs getRecipientTabs(String iRecipientId){

System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 006 ');
Apttus_DocuApi.DocuSignUtil.RecipientTabs objRecipientTabs = new Apttus_DocuApi.DocuSignUtil.RecipientTabs();

//Set values for two text tags and one email tag in the document

Apttus_DocuApi.DocuSignUtil.emailTab objEmailTab = new Apttus_DocuApi.DocuSignUtil.emailTab(iRecipientId,'email'+iRecipientId+'@test.com','40','0','0');
Apttus_DocuApi.DocuSignUtil.textTab objTextTab = new Apttus_DocuApi.DocuSignUtil.textTab(iRecipientId,'text'+iRecipientId,'40','0','0');
Apttus_DocuApi.DocuSignUtil.textTab objTextTab1 = new Apttus_DocuApi.DocuSignUtil.textTab(iRecipientId,'title'+iRecipientId,'40','0','0');


objEmailTab.name = 'Email'+iRecipientId;
objEmailTab.tabLabel = 'Email'+iRecipientId;
objEmailTab.anchorString = '\\e'+iRecipientId+'\\';

objTextTab.name = 'Text'+iRecipientId;
objTextTab.tabLabel = 'Text'+iRecipientId;
objTextTab.anchorString = '\\tx'+iRecipientId+'\\';

objTextTab1.name = 'SecondText'+iRecipientId;
objTextTab1.tabLabel = 'SecondText'+iRecipientId;
objTextTab1.anchorString = '\\t'+iRecipientId+'\\';

objRecipientTabs.addEmailTab(objEmailTab);
objRecipientTabs.addTextTab(objTextTab);
objRecipientTabs.addTextTab(objTextTab1);

System.debug(System.LoggingLevel.ERROR, 'SETTER : Sep 007 ');
return objRecipientTabs;

}
}