#DocuSignAPI and using the CRCL parameter - docusignapi

I have a question about the CRCL parameter in a Custom Related List using the #DocuSignAPI.
Besides the example listed in the documentation, does anyone have any examples to share? Does this mean this button can be put on a related list in Salesforce and be able to mass send? Does it mass send to all at once??

Sounds like you are referring to Custom Button Logic in DocuSign for Salesforce. The CRCL parameter allows the selection of recipients from a custom list related to the object where the button is placed.
The parameters do not affect the placement of the button. This is handled by placing the button in the Salesforce "layout".
If your goal is to send documents to many recipients you can either hard code the recipients in the CRL parameter, load default contacts from the object or use CRCL to define recipients from a custom list related to the object.
Here is Custom Button code sample to send to multiple hard coded
recipients using the CRL parameter.
{!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='';
//*************************************************//
CCRM = 'Signer 1~Signer 1;Signer 2~Signer 2;Signer 3~Signer 3';
CCTM = 'Signer 1~Signer;Signer 2~Signer;Signer 3~CarbonCopy';
CRL = 'Email~sam#sample.com;FirstName~Sam;LastName~Sample;Role~Signer 1;RoutingOrder~1;Email~{!Opportunity.OwnerEmail};FirstName~Sally;LastName~Simple;Role~Signer 2;RoutingOrder~2;Email~sue#simple.com;FirstName~Sue;LastName~Simple;Role~Signer 3;RoutingOrder~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;
//*******************************************//

Related

DocuSign - Add pre-fill tabs through JSON marker

I'm creating a html document and want to place tabs using JSON markers. This method works for common tabs of signers. However, I want to add pre-fill tabs for senders using the same approach but all pre-fill tabs are not showing up.
I'm using CompositeTemplate to generate the envelope. As pre-fill tabs don't belong to any recipients, so I put them under document level. The code snippet looks like
EnvelopeDefinition().apply {
emailSubject = ...
emailBlurb = ...
this.status = "created"
compositeTemplates = listOf(
CompositeTemplate().apply {
document = Document().apply {
documentId = "1"
name = "some document.pdf"
htmlDefinition = "<div>{{\"tabLabel\": \"exampleTextTab\"}}</div>"
tabs = Tabs().apply {
prefillTabs = listOf(
PreFillTab().apply {
tabLabel = "exampleTextTab"
font = "arial"
fontSize = "size8"
locked = "true"
}
)
}
Pre-fill tabs don't currently work with Composite Templates. DocuSign internal ticket TT-5404
Solutions
Will your API program be setting the values of the pre-fill tabs? If so, then don't use pre-fill tabs. Instead:
use regular tabs with the first signer
set the locked attribute to true
This makes the tabs read-only and they will be visible to all recipients. This will have the same effect as your API application adding and setting pre-fill tabs to the envelope.
Pre-fill tabs are needed when the Sender needs to fill in the values and the Sender is not one of the recipients of the envelope.
For an API program that uses the Sender View to enable the Sender to review the envelope and fill in pre-fill tabs, there are some options:
Your API application can ask the Sender for the pre-fill tab values. Your application can then set those values as regular (locked) tabs as described above.
Or you could add the pre-fill tabs to the template itself.
Or (I have not tried this), instead of adding the pre-fill tabs as part of the composite template object, make an additional API call to add the pre-fill tabs by using EnvelopeDocumentTabs:create

How can I attach a Custom Tab to a Docusign Envelope?

Looking through the Docusign API documentation I am unable to figure out how to attach a Custom Tab to an Envelope. Using the traditional tabs sometimes forbid me from setting the text. Hence, the need for a Custom Tab. Using the CustomTabsAPI I can create a Custom Tab. What remains is the ability to attach the Custom Tab to the envelope.
You can add custom tabs to envelopes and templates by setting the
customTabId property when creating an envelope, template recipient, or
when adding a new tab for an existing recipient.
I am using the EnvelopeDefinition to create my envelope. I was expecting something like:
envelope_definition = EnvelopeDefinition(
custom_fields=custom_fields,
documents=documents,
recipients=recipients,
status='created',
event_notification=event_notification,
email_settings=email_settings,
custom_tabs=custom_tabs # <------ SOMETHING LIKE THIS
)
Any suggestions? An example of how to add custom tabs? Documentation? TIA
EDIT: Here is the textTab I currently have in place
signer = Signer(**args)
title_text = Text(
anchor_string=anchor_string,
anchor_units="pixels", anchor_y_offset="10",
anchor_x_offset="0", width="180", value=initial_value
)
signer.tabs = Tabs(text_tabs=[title_text])
example img of text not editable
example img of custom tab this can be edited
If I can get the TextTab to be edited, that would be great.
Summary of the solution:
The title tab is a system tab so the value can't be set.
Instead, the OP will use a text tab, set its value, and set the attribute locked to false to enable the signers to update it.

Alert in view record for Netsuite

I have been trying to get a alert in Netsuite for view mode but can't get it for customer record.
Though when I tried to get the alert for the edit record then I got it but I want it for view.
I tried client script, user event script and also workflow. But all support only for edit. Can I get the alert by any means for the view record option.
Thanks
Gladiator
One workaround that I've done is to add a custom field of type 'Inline HTML' to the customer form. Then during the beforeLoad event you can check if type == 'view' and update the custom field's value with the HTML that is needed to display the alert.
Basically form.setScript used to work with SS1 but there was no (not hacked) API access to Netsuite's alerts
SS2.0 gives nice access to the alert system but it doesn't load in view mode unless you take a supported action (clicking a button)
See this answer for a sample with SS2 that loads your script and shows an integrated alert.
SS2.0 Display Message on Record
Thanks Mike, Michoel and Bknights.
Here is the solution to the problem.
Create an inline html field on the customer form.
Since the field does not store value nlapiSetFieldValue for before load function works absolutely fine.
Below is the snippet of the working code.
function before_load(type)
{
if (type == 'view')
{
var pass_value = "<html><body><script type='text/javascript'>window.alert('Hello World!!!')</script></body></html>";
nlapiSetFieldValue("custentity25", pass_value); //custentity25 is the id of Inline HTML field we created
}
}
Note : The "" used should be different then the one used in the HTML code which is ''. If same are used then there will be an error.
You need to use a User Event Script, and in the before load event, set a Client Script via form.setScript(). In your "injected" Client Script, you can display the alert.

DocuSign custom tags - CustomTabRequired property

I am using DocuSign's SOAP based API calls to create envelope(s) into the selected DocuSign account. While adding custom tags, if I do not require recipient to enter the information in the custom tag, I setup the custom tag property "CustomTabRequired" to false. If I require recipient to enter the information in the custom tag, I set the the custom tag property
"CustomTabRequired" to true and "CustomTabRequiredSpecified" to true.
When an envelope gets created and if I haven't setup the custom tag required property to true, it still forces recipient to fill in the information in order to complete the signing process.
Is there anything that I need to setup other than these two properties?
I have observed this behavior for my DocuSign demo account as well as live account.
Please advise.
We've connected outside of Stack Overflow and found that some properties are being dropped from your request, but for the benefit of the community-
When using the DocuSign SOAP API and creating a custom tab, you just need to make sure the CustomTabRequired property is set to true. For instance, in PHP you could create the tab like this:
//+++ Add Custom Tab +++
$tab = new Tab();
$tab->DocumentID = "1";
$tab->RecipientID = "1";
$tab->PageNumber = "1";
$tab->Type = TabTypeCode::Custom;
$tab->Name = "CustomTextTag1";
$tab->TabLabel = "CustomTextTag1";
$tab->CustomTabType = CustomTabType::Text;
$tab->CustomTabRequired = false;
$tab->XPosition = "100";
$tab->YPosition = "100";
The important bit that makes the tab optional as you are trying to accomplish is this:
$tab->CustomTabRequired = false;
As long as that property is present in your request it will make the tab in question optional. Please note that if using DocuSign's REST API the corresponding JSON property is simply labeled as required.

#Mailsend in xpages button

In Client Notes programming there is an action button:
#MailSend(Destinatari;"";"";"Subject";"";"";IncludeDoclink])&
#Command([FileSave])&#Command([FileCloseWindow])
I want to make a similar action in my xpage application which works both in XPiNC and web.
My sendto field is a DjTextarea which can have multiple values.
I tried to create a simple action for my button from xpage: Action: Send Mail. In this way, can I embedded < the IncludeDoclink from Lotus Notes> in the body of the mail? Or I need to write a javascript for this action?
Thanks for your time!
UPDATE: following #Lothar suggestions, my Save & Send button has the following code lines:
if(frmDoc.isNewNote()){
frmDoc.save();
}
var thisdoc = frmDoc.getDocument();
var tempdoc = database.createDocument();
tempdoc.replaceItemValue("Form", "Memo");
tempdoc.replaceItemValue("SendTo", thisdoc.getItemValue("txt_names"));
tempdoc.replaceItemValue("Subject", "subject");
var tempbody:NotesRichtextItem = tempdoc.createRichTextItem("Body");
tempbody.appendText("This is my Mail, click on the doc link below to open the original doc:")
tempbody.addNewLine(2);
tempbody.appendDocLink(thisdoc);
tempdoc.send();
thisdoc.recycle();
tempbody.recycle();
tempdoc.recycle();
Where frmDoc is my doc datasource. I get an error like: NotesRichTextItem.appendDocLink(lotus.domino.local.Document) null - at the appendDoclink line. - the same error I noticed in the #Fredrik useful suggestion too.
I use the HTML email function that can be found in xSnippets when sending emails in xpages.
XSnippet SSJS HTML Mime emails
or
XSnippet email Bean
None of them as an function for attaching a doclink, but you could manually add an url to the document.
Another way is to create the email manually by creating a document is the database
adding a richtextfield called body and a subject and a sendto field.
And adding a doclink to the Body field.
var doc:NotesDocument = database.createDocument();
var My_DocLink_Doc:NotesDocument=database.getDocumentByUNID("UNID_of_Document")
doc.replaceItemValue("form", "Memo");
doc.replaceItemValue("sendTo", "the_emailadress");
doc.replaceItemValue("subject", "an email to you");
var RT:NotesRichTextItem=doc.createRichTextItem("Body")
RT.appendText("This is my Text")
RT.addNewLine()
RT.appendDocLink(My_DocLink_Doc)
doc.send();
There's really not much to add to Fredrik's answer, but I'm afraid you might be looking at the wrong pieces of his solution. I just tested it myself, and it's working just fine, so here's the result, step-by-step:
my xpage is bound to a Notes form named testMail using a document datasource called mailDoc. It is built like this:
Control#1 is a textarea with a multiple separator set to a comma, so that I can enter multiple mail addresses separated by commas. The textarea is bound to a Notes field named SendTo:
<xp:inputTextarea
value="#{mailDoc.SendTo}"
id="sendTo1"
multipleSeparator=",">
</xp:inputTextarea>
Control #2 is a simple EditBox control bound to a Notes field named Subject:
<xp:inputText
value="#{mailDoc.Subject}"
id="subject1">
</xp:inputText>
A button control labelled Save & Send first saves the current document if it is New (i.e. has never been saved before), then performs all the necessary steps to send a doclink for the currently opened doc (button's onclick event); in the following code I'm using these variables:
mailDoc = my datasource object;
thisdoc = the backend doc object that the datasource is bound to;
tempdoc = a temp backend doc object used to be sent via Notes mail:
if(mailDoc.isNewNote()){
mailDoc.save();
}
var thisdoc = mailDoc.getDocument();
var tempdoc = database.createDocument();
tempdoc.replaceItemValue("Form", "Memo");
tempdoc.replaceItemValue("SendTo", thisdoc.getItemValue("SendTo"));
tempdoc.replaceItemValue("Subject", thisdoc.getItemValue("Subject"));
var tempbody:NotesRichtextItem = tempdoc.createRichTextItem("Body");
tempbody.appendText("This is my Mail, click on the doc link below to open the original doc:")
tempbody.addNewLine(2);
tempbody.appendDocLink(thisdoc);
tempdoc.send();
thisdoc.recycle();
tempbody.recycle();
tempdoc.recycle();
Result: the button code sends a mail containing a Notes document link to all the recipients that I previously entered in the SendTo field.
If I set the testMail form's property to use the Xpage in Notes (Defaults >> On Open >> Display Xpage instead >> mailSendTest), then this also works for the XPinc version. And if the recipient then clicks on the doc link the originating document of course opens in XPinc mode as well.
Remark:
I need to save the originating doc at least once otherwise the appended doc link might not be usable for the recipients; could this have been the reason why Fredrik's answer didn't work for you?
Hope this helps. If this is working for you please accept Fredrik's answer.
Update:
Changed some variable names in my code example to clarify things
I simply use these two lines:
var url =
#Left(facesContext.getExternalContext().getRequest().getRequestURL(),"newDocument.xsp")+"newDocument.xsp?documentId="+document1.getDocument().getUniversalID()+"&action=openDocument";
rtitem.appendText(url);
where newDocument.xsp is the form xsp of the document, rtitem is the rich text field of the mail. That will add the whole link to your document.

Resources