I am implementing a excel web addin. I took a template project(excel web addin) using Visual Studio.
Here in code i need to call a URL. that will open in browser popup for login, after login it will have few events like user need to click allow access button. then it will navigate some other URL in same window. now i need to get that URL to my code.
I am able to call the URL and it is opening in browser. but after this i dont any object reference or context to control browser.
Below is the code i written.
SampleNav.js
var w = 800;
var h = 500;
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
var dialog = window.open("myurl", "window1", 'width=' + w + ',height=' + h + ',scrollbars=NO, top=' + top + ', left=' + left);
console.log("testDialog: " + window.location.pathname);
console.log("testDialog: " + window.location.hostname);
console.log("testDialog: " + window.location.assign);
console.log("testDialog: " + window.location.href);
console.log("testDialog: " + dialog.location.pathname);
console.log("testDialog: " + dialog.location.hostname);
console.log("testDialog: " + dialog.location.assign);
console.log("testDialog: " + dialog.location.href);
I tried to find something in dialog reference but no use
please suggest needful
Related
In the below code i used label and text box to send data to sql . but instead of using label and textbox i want to send data from one table to another on button click . please let me know the shortest path .
SqlConnection con1 = new SqlConnection(strcon);
con1.Open();
SqlCommand com = new SqlCommand("update coupon set status =('" + Label2.Text + "'),macaddress =('" + mac.Text + "') where accode =('" + usename.Text + "')", con1);
com.ExecuteNonQuery();
con1.Close();
AddNewUserToNomadix();
What code should i add in this in order to show a static text on document(like Amount charged, client name, company name etc) at some place that the user can't change at the time of signing the document and it should show up in the downloaded signed document from Docusign, i am using the request signature on document api walkthrough in this.
Thanks in advance.
string xmlBody =
"<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<emailSubject>DocuSign API - Signature Request on Document</emailSubject>" +
"<status>sent</status>" + // "sent" to send immediately, "created" to save as draft in your account
// add document(s)
"<documents>" +
"<document>" +
"<documentId>1</documentId>" +
"<name>" + documentName + "</name>" +
"</document>" +
"</documents>" +
// add recipient(s)
"<recipients>" +
"<signers>" +
"<signer>" +
"<recipientId>1</recipientId>" +
"<email>" + recipientMail + "</email>" +
"<name>" + recipientName + "</name>" +
"<tabs>" +
//myTestCodeStart
"<tab>" +
"<DocumentID>1</DocumentID>" +
"<RecipientID>1</RecipientID>" +
"<PageNumber>1</PageNumber>" +
"<XPosition>100</XPosition>" +
"<YPosition>100</YPosition>" +
"<ScaleValue>1</ScaleValue>" +
"<Type>Custom</Type>" +
"<Name>TestName</Name>" +
"<TabLabel>LabelTest</TabLabel>" +
"<Value>TestValue</Value>" +
"<CustomTabType>Text</CustomTabType>" +
"<CustomTabWidth>42</CustomTabWidth>" +
"<CustomTabHeight>11</CustomTabHeight>" +
"<CustomTabRequired>true</CustomTabRequired>" +
"<CustomTabLocked>true</CustomTabLocked>" +
"<CustomTabDisableAutoSize>false</CustomTabDisableAutoSize>" +
"<CustomTabValidationPattern/>" +
"<CustomTabValidationMessage/>" +
"<RequireInitialOnSharedTabChange>false</RequireInitialOnSharedTabChange>" +
"<ConcealValueOnDocument>false</ConcealValueOnDocument>" +
"<Bold>false</Bold>" +
"<Italic>false</Italic>" +
"<Underline>false</Underline>" +
"</tab>" +
//myTestCodeEnd
"<signHereTabs>" +
"<signHere>" +
"<xPosition>350</xPosition>" + // default unit is pixels
"<yPosition>517</yPosition>" + // default unit is pixels
"<documentId>1</documentId>" +
"<pageNumber>1</pageNumber>" +
"</signHere>" +
"</signHereTabs>" +
"</tabs>" +
"</signer>" +
"</signers>" +
"</recipients>" +
"</envelopeDefinition>";
To make a tab value read-only in the Envelope, set the locked property to true for that tab.
<locked>true</locked>
For example, including this XML within a "Create Envelope" request would place the read-only text 123456 within the document (at the specified X/Y location):
<textTabs>
<textTab>
<tabLabel>AcctNumber</tabLabel>
<locked>false</locked>
<name>Account Number</name>
<value>123456</value>
<xPosition>100</xPosition>
<yPosition>200</yPosition>
<font>arial</font>
<fontSize>12</fontSize>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
</textTab>
</textTabs>
(Your code shows you using <tab> -- which isn't a valid element name in the REST API. Seems like you should be using <textTabs> and <textTab> as I show in the exxample above.)
I am trying to populate a look-up column in a list, via the web service.
I am getting my data from an asp.net web form and using the web service method UpdateListItems and sending batch XML.
However, unless the user enters the exact data that the look up uses, the web service returns an error.
Is there anyway i can give the user of the web form, similar look-up functionality in order that the data passed will be identical?
i'm using share point 2007
The data source for the look-up column in share point is active directory.
_x0028_HR_x0029__x0020_Partner is the look up column, entering the users login name will look up their full name/ you can pick from a list.
Your help is much appreciated.
ClasService.Lists NewStarterList = new ClasService.Lists();
NewStarterList.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["SPUserName"].ToString(),
ConfigurationManager.AppSettings["SPPassword"].ToString(), ConfigurationManager.AppSettings["SPDomain"].ToString());
NewStarterList.Url = ConfigurationManager.AppSettings["SPUrl"].ToString() + ConfigurationManager.AppSettings["SPServicePath"].ToString();
try
{
string strBatch = "<Method ID='1' Cmd='Update'>" +
"<Field Name='ID'>" + clasStarter.ClasID + "</Field>" +
"<Field Name='Title'>" + clasStarter.Name + "</Field>" +
"<Field Name='_x0028_HR_x0029__x0020_Job_x0020'>" + clasStarter.JobTitle + "</Field>" +
"<Field Name='Entity'>" + clasStarter.Entity + "</Field>" +
"<Field Name='Practice_x0020_Groups'>" + clasStarter.PracticeGroup + "</Field>" +
"<Field Name='Dept'>" + clasStarter.Department + "</Field>" +
"<Field Name='Physical_x0020_Desk_x0020_Locati'>" + clasStarter.Location + ", " + clasStarter.LocationInBuilding + ", " + clasStarter.Department + "</Field>" +
"<Field Name='_x0028_HR_x0029__x0020_Line_x002'>" + clasStarter.LineManager + "</Field>" +
"<Field Name='_x0028_HR_x0029__x0020_Buddy'>" + clasStarter.Buddy + "</Field>" +
"<Field Name='_x0028_HR_x0029__x0020_Partner'>" + clasStarter.Partner + "</Field>" +//is a look up
"</Method>";
XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlElement elBatch = xmlDoc.CreateElement("Batch");
elBatch.SetAttribute("OnError", "Continue");
elBatch.SetAttribute("ListVersion", "1");
elBatch.SetAttribute("ViewName", ConfigurationManager.AppSettings["SPViewID"].ToString());
elBatch.InnerXml = strBatch;
XmlNode ndReturn = NewStarterList.UpdateListItems(ConfigurationManager.AppSettings["SPListID"].ToString(), elBatch);
}
catch (Exception exp)
{
throw new Exception("NewStarterForm - Clas Update failed ", exp);
}
I haven't figured out a full solution my problem, but i have figured out part of it.
Share point look-up columns have two parts, an id and a value. If you don't know the value then you can just use -1;# as a substitute for the ID
an example of this is
"<Field Name='Partner'>-1;#" + partnerLogOnId + "</Field>"
I will probably use a list, that allows users of my form to select people, and will pass the partnerLogOnId to my web service method.
I am inserting a list item using sharepoint web services....
Here is my code:
item += #"<Field Name=""HyperLinkField"">" + this.SharePointSiteAddressLinks + #"/lists/" + this.ListName + #"/" + this.ID + "_" + this.MessageID + ", " + this.MessageID + ".ext</Field>";
the value of SharePointSiteAddressLinks is http://machineName
The list item gets inserted into the list, but the value of the hyperlink is set to http://localhost
Firstly - why does SharePoint take it apon itself to (incorrect) my links, 2ndly what can I do to turn it off?
Thank you
Restarted the server, everything worked fine....
Pagination (Next button) doesn't work for custom BusinessDataListWebPart.
I am adding BusinessDataListWebPart using code. Everything works fine. I can see 20 data raw at the same time but when I click "Next Button", I can not see next 20-40 data. A postback occurs, but the pageindex never changes.
I am using following code to add BusinessDataListWebPart to the Sharepoint site.
BusinessDataListWebPart consumer = new BusinessDataListWebPart();
consumer.Title = title;
consumer.Application = instance.Name;
consumer.Entity = projEntity.Name;
consumer.XslLink = "/Style%20Library/XSL%20Style%20Sheets/" + xslFileName;
consumer.PageSize = 20;
OK..I found the answer.
For pagination I needed to add "ParameterBindings" to the business data list webpart.
My final code is, It works perfect.
BusinessDataListWebPart consumer = new BusinessDataListWebPart();
ServerContext serverContext = ServerContext.GetContext(site);
SqlSessionProvider.Instance().SetSharedResourceProviderToUse(serverContext);
LobSystemInstance instance = ApplicationRegistry.GetLobSystemInstanceByName(applicationName);
Entity projEntity = instance.GetEntities()[entityName];
consumer.Title = title;
consumer.Application = instance.Name;
consumer.Entity = projEntity.Name;
consumer.XslLink = "/Style%20Library/XSL%20Style%20Sheets/" + xslFileName;
consumer.PageSize = 20;
consumer.ParameterBindings = "<ParameterBinding Name=" + "\"dvt_firstrow\"" + " Location=" + "\"Postback;Connection\"" + "/>" +
" <ParameterBinding Name=" + "\"dvt_sortdir\"" + " Location=" + "\"Postback;Connection\"" + "/>" +
" <ParameterBinding Name=" + "\"dvt_sortfield\"" + " Location=" + "\"Postback;Connection\"" + "/>" +
" <ParameterBinding Name=" + "\"dvt_filterfields\"" + " Location=" + "\"Postback;Connection\"" + "/>" +
" <ParameterBinding Name=" + "\"dvt_partguid\"" + " Location=" + "\"Postback;Connection\"" + "/>";