I am using DocuSign SOAP API in C# .NET application. I need to add an anchortab for the Company name. The tab is added but is modifiable by the signer. How do I disable so that the signer can not modify the value? The code is as below.
tab18 = new DocuSignAPI.Tab();
tab18.RecipientID = rcpt1.ID;
tab18.PageNumber = "17";
tab18.DocumentID = docId;
tab18.Type = DocuSignAPI.TabTypeCode.Company;
tab18.AnchorTabItem = new DocuSignAPI.AnchorTab();
tab18.AnchorTabItem.AnchorTabString = "Company Name:";
tab18.AnchorTabItem.Unit = DocuSignAPI.UnitTypeCode.Pixels;
tab18.AnchorTabItem.YOffset = 0;
tab18.AnchorTabItem.XOffset = 50;
You should be able to achieve the behavior you've described by setting the tab's Locked property to true. For info about tab properties, see the EnvelopeRecipientTabs page in the DocuSign API docs.
Related
We are using DocuSign's RESTful APIs to create and send envelopes for our clients for last few years with .net framework. We have encountered a strange issue using the Approve tab with a few of our clients' accounts. For some clients' accounts, we are able to add the Approve tab fine while we are receiving an exception while adding the Approve tab for other client accounts. Here is how we are adding the Approve tab from our codebase.
If signer.Tabs.ApproveTabs Is Nothing Then
signer.Tabs.ApproveTabs = New List(Of DocuSign.eSign.Model.Approve)
End If
Try
Dim approvatab As New DocuSign.eSign.Model.Approve
If Not currtab.anchorIgnoreIfNotPresent Is Nothing Then
approvatab.AnchorIgnoreIfNotPresent = currtab.anchorIgnoreIfNotPresent
End If
approvatab.AnchorString = currtab.anchorString
approvatab.AnchorUnits = currtab.anchorUnits
approvatab.AnchorXOffset = currtab.anchorXOffset
approvatab.AnchorYOffset = currtab.anchorYOffset
If Not currtab.bold Is Nothing Then
approvatab.Bold = currtab.bold
End If
approvatab.ButtonText = currtab.buttonText
approvatab.ConditionalParentLabel = currtab.conditionalParentLabel
approvatab.ConditionalParentValue = currtab.conditionalParentValue
approvatab.Font = currtab.font
approvatab.FontColor = currtab.fontColor
approvatab.FontSize = currtab.fontSize
approvatab.Height = currtab.height
If Not currtab.italic Is Nothing Then
approvatab.Italic = currtab.italic
End If
approvatab.PageNumber = currtab.pageNumber
approvatab.RecipientId = currtab.recipientId
approvatab.TabId = currtab.tabId
approvatab.TabLabel = currtab.tabLabel
approvatab.TabOrder = currtab.tabOrder
If Not currtab.underline Then
approvatab.Underline = currtab.underline
End If
approvatab.Width = currtab.width
approvatab.XPosition = currtab.xPosition
approvatab.YPosition = currtab.yPosition
approvatab.DocumentId = currtab.documentId
signer.Tabs.ApproveTabs.Add(approvatab)
Catch ex As Exception
Dim errmsg As String = ex.Message.ToString
End Try
The exception that we are getting while adding the Approve tab is
"Conversion from string "false" to type 'Long' is not valid"
The same code works fine for some of our clients' accounts and we are able to add the Approve tab fine.
Please advise,
Minal
Here are some recommendations:
Consider using the eSign Nuget Package. It works for VB code as well as C# code. Since it's generated from the swagger file of the DocuSign eSignature REST API it is always consistent with the latest API.
Make sure to use the v2.1 version of the eSign API and not version 2.0
Note that sometimes the API expect "false" and other times false for a Boolean value (meaning it's a string in some cases whereas it's a Boolean in the JSON in others). It's possible that there are temporary differences between customers' accounts configurations, but in the long term if you use the latest eSign API - they should behave the same.
Lastly, it could be a case of a misleading error message which hides the real issue with the account. If the issue persists I would advise to contact customer support with account numbers to try to find out.
My application allows multiple sales quotes to go out in a single pdf packet. At the bottom of each quote is an Accept (quote#) Decline (quote#) radio group. Using the DocuSign API I am attaching a radio group to each of these accept/decline sections on each quote. There is no "required" option at the group level so I set "required" on one of the radio's which makes the group required.
This all works great except the signing flow through the document. If I choose "Accept" which is the first radio and hit "Next" it changes to "Choose" and seems to want me to choose "Decline" as well. If I hit "Choose" it moves on to the next radio group. If I choose "Decline" it moves on to the next radio group as it should (I assume because its the last radio item in the group). If I am at the last radio group I can choose "Accept" and its finished.
It seems like a bug to me since you can only choose a single radio group item, doing so with required should fulfill this requirement with any selection. I would like it to move on to the next radio group after either selection. Has anyone run into this issue and found a work around or solution?
for (var i = 0; i < parts.Count; i++) {
Radio approve = new Radio();
approve.AnchorString = "Accept " + parts[i].Substring(0,parts[i].Length-3) + "-" + parts[i].Substring(parts[i].Length-2,2); approve.Value = "Accept";
approve.Required = "true";
approve.AnchorMatchWholeWord = "true";
approve.AnchorUnits = "pixels";
approve.AnchorXOffset = "-19";
approve.AnchorYOffset = "-4";
Radio decline = new Radio();
decline.AnchorString = "Decline " + parts[i].Substring(0,parts[i].Length-3) + "-" + parts[i].Substring(parts[i].Length-2,2); decline.Value = "Decline";
decline.AnchorMatchWholeWord = "true";
decline.AnchorUnits = "pixels";
decline.AnchorXOffset = "-19";
decline.AnchorYOffset = "-4";
List<Radio> radioVals = new List<Radio>();
radioVals.Add(approve);
radioVals.Add(decline);
RadioGroup rg = new RadioGroup();
rg.GroupName = parts[i].Substring(0,parts[i].Length-3) + "-" + parts[i].Substring(parts[i].Length-2,2);
rg.Radios = radioVals;
signer.Tabs.RadioGroupTabs.Add(rg);
}
Please see the DocuSign blog post Guide Your Signers Through Documents with the Auto-Navigation Feature
We are setting up the document to have an optional text field. We are using DocuSign SOAP API.
We have added Tab configuration, with anchor string, to specify details of custom Text box. The text box appears in the document, but it's always mandatory. Here is the configuration which we setup.
I have gone through various DocuSign support tickets, and community but couldn't find a solution for the same. Please let us know if there is anything missing, or we have a workaround for the same.
I don't see the definition of CustomTabRequiredSpecified in wsdl.
Snippet
Tab.RecipientID = "1"
Tab.DocumentID = "1"
Tab.Type = "Custom"
Tab.AnchorTabItem.AnchorTab.XOffset = 0
Tab.AnchorTabItem.AnchorTab.YOffset = 0
Tab.AnchorTabItem.AnchorTab.IgnoreIfNotPresent = True
Tab.AnchorTabItem.AnchorTab.AnchorTabString = "AnchorString"
Tab.CustomTabWidth = 100
**Tab.CustomTabRequired = False**
Tab.CustomTabType = "Text"
Tab.TabLabel = "UniqueNameField"
Tab.TemplateRequired = False
Tab.SharedTab = True
Tab.RequireAll = False
I was able to make the text tab optional with these 2 lines of code:
Tab.CustomTabRequired = false;
Tab.CustomTabRequiredSpecified = true;
Please make sure you are referencing this WSDL: https://www.docusign.net/api/3.0/dsapi.asmx?wsdl
I've a SharePoint 2010 page with a list. The list has several items and a field named "Department" and must filter items based on user's department value retrieved from user profile.
To do this I've created a feature which upon activation adds UserContextFilterWebPart to the page and makes connection between UserContextFilterWebPart and XsltListViewWebPart. After the feature is activated I can see in the page design mode that connection is established but the list gets empty. Then I open web part's menu, choose "Connections" then "Send Filter Values To" and click "List1". When dialog appears I do nothing but only click "Finish" button and it begins to work fine. Can anybody please explain me why the connection begins to work only if I do that manual extra action? What must be done to fix?
I tried different way when List.Views[0].Query property is set to appropriate CAML query and it also works fine. But I'm told that it's not a good approach because of performance and parallel tasks issues. Is it really bad course of action?
Below is the code for 2 different approaches.
Thanks in advance!
1-s variant with UserContextFilterWebPart:
SPSite Site = new SPSite(URL);
SPWeb Web = Site.OpenWeb();
SPLimitedWebPartManager WPM = Web.GetLimitedWebPartManager(URL, PersonalizationScope.Shared);
XsltListViewWebPart List = WPM.WebParts[0] as XsltListViewWebPart;
UserContextFilterWebPart UCFWP = new UserContextFilterWebPart();
UCFWP.Title = "Current User Filter";
UCFWP.AllowEdit = true;
UCFWP.FilterName = "Current User";
UCFWP.SendEmptyWhenNoValues = true;
UCFWP.AllowClose = true;
UCFWP.ExportMode = WebPartExportMode.All;
UCFWP.AllowConnect = true;
UCFWP.AllowHide = true;
UCFWP.ProfilePropertyName = "Department";
UCFWP.ValueKind = UserContextFilterValueKind.ProfileValue;
UCFWP.ZoneID = "Main";
WPM.AddWebPart(UCFWP, UCFWP.ZoneID, 1);
WPM.SaveChanges(UCFWP);
ConsumerConnectionPointCollection consumerConnections = WPM.GetConsumerConnectionPoints(List);
ConsumerConnectionPoint addConsumerConnPoint = consumerConnections["DFWP Filter Consumer ID"];
ProviderConnectionPointCollection providerConnections = WPM.GetProviderConnectionPoints(UCFWP);
ProviderConnectionPoint addProviderConnPoint = providerConnections["ITransformableFilterValues"];
TransformableFilterValuesToParametersTransformer trans = new TransformableFilterValuesToParametersTransformer();
trans.ConsumerFieldNames = new string[] { "Department" };
trans.ProviderFieldNames = new string[] { "Department" };
SPWebPartConnection newConnection = WPM.SPConnectWebParts(UCFWP, addProviderConnPoint, List, addConsumerConnPoint, trans);
WPM.SPWebPartConnections.Add(newConnection);
2-nd variant with CAML query (intended to be used not in a feature but in a web part):
SPSite Site = new SPSite(URL);
SPWeb Web = Site.OpenWeb();
SPLimitedWebPartManager WPM = Web.GetLimitedWebPartManager(URL, PersonalizationScope.Shared);
XsltListViewWebPart List = WPM.WebParts[0] as XsltListViewWebPart;
SPUser CurrentUser = Web.CurrentUser;
SPServiceContext context = SPServiceContext.GetContext(Site);
UserProfileManager upm = new UserProfileManager(context, false);
UserProfile up = upm.GetUserProfile(CurrentUser.RawSid);
String UserDepartment = up["Department"].Value.ToString();
SPView ListView = Web.Lists["List1"].Views[0];
ListView.Query = "<Where><Eq><FieldRef Name='Department' /><Value Type='Text'>" + UserDepartment + "</Value></Eq></Where>";
ListView.Update();
I had a similar problem of connecting two web parts. I found the answer here: http://kvdlinden.blogspot.dk/2011/02/programmatically-connect-two.html
Note that that post describes how to do it with two XsltListViewWebParts. In order to use it in your case I suggest that you:
Create the connection manually,
Use PowerShell to get a SPLimitedWebPartManager for the page,
Use the manager to iterate through the manager.SPWebPartConnections,
And find the ProviderConnectionPointID for your connection,
Use that ID in the code shown in the post.
Also remember to setup the transformer - you can find this also from the SPWebPartConnections.
Next time you activate your feature you should have a connection equal to the one you made by hand.
I would like to programatically add alert to folders inside a sharepoint list. I have found how to set alerts to a list and this works perfect.
Could someone please help me on how to set alerts to a specific folder which is inside a list.
Below is the code i currently have which sets alerts only to the list.
using (SPSite site = new SPSite("http://site/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser user = web.SiteUsers["domain\\user"];
SPAlert newAlert = user.Alerts.Add();
newAlert.AlertType = SPAlertType.List;
newAlert.List = web.Lists["Documents"];
newAlert.EventType = SPEventType.All;
newAlert.AlertFrequency = SPAlertFrequency.Immediate;
//passing true to Update method will send alert confirmation mail
newAlert.Update(true);
}
}
Your help will be much appreciated
THIS QUESTION IS RESOLVED! PLEASE SEE MY POST BELOW WITH THE LINK - SEE - LINK
That's not possible out of the box, but after googling I found an interesting possibility though, check out Mike Walsh's answer on this post, it entails creating a view in the folder and then attaching the alert to that view.
You need to update the line with
newAlert.List = web.Lists["Documents"];
With
SPFolder fldr = web.GetFolder("/ListName/FolderName");
newAlert.Item=fldr.Item;
Also note that Folder is also another item.