Skip to main content

Using an an SDK to create an envelope. I need to have 2 checkboxes and want client to only be able to choose exactly 1 of those 2 checkboxes. Tried doing something with the group, but it still allows having both empty.

 

function makeEnvelopeCDM(email: string, name: string, document: any) {

const docusignAny = docusign as any;

const env = new docusignAny.EnvelopeDefinition();

env.emailSubject = 'Please sign this document set';



let doc = new docusignAny.Document.constructFromObject({

documentBase64: document,

name: 'Installer Quotation',

fileExtension: 'pdf',

documentId: '1',

});



env.documents = doc];



let signer1 = docusignAny.Signer.constructFromObject({

email: email,

name: name,

recipientId: '1',

routingOrder: '1',

});



let signHere1 = docusignAny.SignHere.constructFromObject({

anchorString: 'Title',

anchorYOffset: '100',

anchorUnits: 'pixels',

anchorXOffset: '25',

});



let title = docusignAny.Title.constructFromObject({

anchorString: 'Title',

anchorYOffset: '0',

anchorUnits: 'pixels',

anchorXOffset: '45',

});



let dateSigned = docusignAny.DateSigned.constructFromObject({

anchorString: 'Title',

anchorYOffset: '56',

anchorUnits: 'pixels',

anchorXOffset: '24',

});



let nameTab = docusignAny.FullName.constructFromObject({

anchorString: 'Title',

anchorYOffset: '-25',

anchorUnits: 'pixels',

anchorXOffset: '17',

});



let checkboxTab1 = docusignAny.Checkbox.constructFromObject({

anchorString: 'Title',

anchorYOffset: '0',

anchorUnits: 'pixels',

anchorXOffset: '250',

tabLabel: 'Checkbox1',

});



let checkboxTab2 = docusignAny.Checkbox.constructFromObject({

anchorString: 'Title',

anchorYOffset: '26',

anchorUnits: 'pixels',

anchorXOffset: '250',

tabLabel: 'Checkbox2',

});



let checkboxGroup = docusignAny.TabGroup.constructFromObject({

groupLabel: 'CheckboxGroup',

tabScope: 'document',

minimumRequired: 1,

maximumAllowed: 1, 

// groupRule: 'SelectExactlyOne', 

tabs: scheckboxTab1, checkboxTab2],

});



let signer1Tabs = docusignAny.Tabs.constructFromObject({

signHereTabs: ssignHere1],

titleTabs: stitle],

dateSignedTabs: sdateSigned],

fullNameTabs: snameTab],

checkboxTabs: scheckboxTab1, checkboxTab2],

tabGroups: scheckboxGroup],

});



signer1.tabs = signer1Tabs;



let recipients = docusignAny.Recipients.constructFromObject({

signers: ssigner1],

});



env.recipients = recipients;

env.status = 'sent';



return env;

}

 

Be the first to reply!

Reply