New answers tagged

0

Once the changes are retrieved via GetChanges method, the first step would be to determine changes that corresponds to a File object type: var changes = ctx.Site.GetChanges(new ChangeQuery(true, true)); //all changes ctx.Load(changes); ctx.ExecuteQuery(); foreach (var change in changes) { var changeFile = change as ChangeFile; if (changeFile !=...


0

You should convert the webpart object to the custom object. First include the dll's which has the custom webpart. Then do as below CustomWebPart cw = wpm.WebParts[0] as CustomWebPart; Now you can access the custom properties of that webpart.


0

You should add a '&$', not just '$' before the orderby clause, like this: "$select=Title,Description,Enlace,EncodedAbsUrl,Categoria/Title&$expand=Categori‌​a/Title&$orderby=Categoria,Title asc";


0

What I used to do in such cases is to use JavaScript and hide unwanted page elements and call JavaScript window.print You can use browser tools to locate the elements you want to hide and do something as below on the Print button click $('#pageElementId').hide();


0

You can Hide ribbon using SPSecurityTrimmedControl based on PermissionsString like ◾FullMask. ◾EmptyMask. ◾ManagePermissions. ◾ManageSubwebs. ◾ManageWeb. ◾AddAndCustomizePages. ◾BrowseDirectories. ◾ViewPages. ◾EnumeratePermissions. ◾ManageAlerts. To hide Ribbon in SharePoint 2013 using CSS check How to hide Ribbon in SharePoint 2013 using CSS Also for ...


2

For anyone interested I accomplished this using a simple css edit in the head of the page code below if anyone needs: <style type="text/css"> #contentBox {margin-left: 20px !important;} #SearchBox {display:none;} #suiteBarTop {display:none !important;} #s4-ribbonrow{display:none !important;} </style> <Sharepoint:...


0

I just found out how to get these Settings: there are two properties in the NavigationTerm ExcludeFromGlobalNavigation Msdn Link (Global) ExcludeFromCurrentNavigation Msdn Link (current) here I have a shortened my timerJob where i create a custom sitemap.xml based on the SPFileLevel and the ExcludeFromGlobalNavigation property for example purposes: ...


0

From what I could find, in order to perform operations on Office 365, we need to authenticate using claims-based authentication, which is done in not one, but a series of sequential steps. build a SAML request submit a SAML token request to Microsoft Online Security Token Service receive a signed security token POST the token to SharePoint Online receive ...


0

Add the following code below class definition. [WebBrowsable(true), WebDisplayName("Project ID"), WebDescription("Enter Project Number"), Personalizable(PersonalizationScope.Shared), Category("Project Settings")] public string ProjectID { get; set; } To get the property value in code, you should use the “ProjectID” variable that defined as public string ...


3

You can use both namespaces, you just have to set up a way of disambiguating which WebPart class you are referring to when you refer to it. One way of doing that would be to include the entire namespace when you refer to the WebPart class, i.e.: public partial class VisualWebPart1 : System.Web.UI.WebControls.WebParts.WebPart Another option, and the first ...


1

I think the issue is here , as you said the new one is created in SharePoint designer and the old one is deployed through a wsp. You should modify your master page via the visual studio then deploy it again . to let this control registered as safe in Web.Config. you current method only working if master page branded with SP designer, not visual ...


0

Assuming that you are all sorted with your file paths, I would suggest you to update the list first before updating the listItem. newFile.Url = filepath + "\\" + Path.GetFileName(path); List docs = web.Lists.GetByTitle(listname); Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile); context.Load(docs); //Update the list ...


0

Using PowerShell you can update the lookup list Id $webURL = "http://server/sites/XY" $listName = "MyList" $columnName = "MyColumn" $lookupListName = "Category" $lookupWebURL = "http://server/sites/X" RepairListLookupColumns -webURL $webURL -listName $listName -columnName $columnName -lookupListName $lookupListName -lookupWeb $lookupWebURL Function ...


2

You can use an <asp:TextBox> control for oldHostURL if you want to access the .Text property. input elements are represented as HTML Input Controls in server side code. The specific type depends on the type attribute. When using type="text" these become HtmlInputText which doesn't have a Text property. Instead you'll need to use Value. oldHostURL....


0

there are couple of ways to move the production data into Dev. But before start you have to make sure. Source Farm and Dev Farm both should be on same Version(patch level). if you use the backup-spsite and restore-SPsite then it should be same level. But if you use the Content Database method then if destination level is higher it will work but if ...


0

The content database is one of the steps that will make your dev environment identical to production. but as it's named it only match content not configuration like application services. Regarding restoring your backup content database, you can also check How to Restore / Migrate a SharePoint Web Application to another farm from SQL Database Backup


0

You should create a Visual Webpart in Visual Studio. Once this done, you can drag and drop the text box and button from Toolbox. Next double click the button which automatically creates an event handler. In the handler code you can write OldHostURL.Text = TextBox.Text;


0

There are many way to do this. Based on my experience the easiest option is Store the data in SQL server (Or you can store the data in SP Lists itself.. in this case you can use JSOM API's) Create External Content Type and External Lists to Manage the data (CRUD Operations) Create a Visual WebPart using Server Side Object Model and query the BCS connection ...


0

You can use the below code to find WebApp url, this takes care of port number too (if exists) var WebAppUrl=""; if (location.port) { WebAppUrl = window.location.protocol + "//" + window.location.host + ":" + location.port; } else { WebAppUrl = window.location.protocol + "//" + window.location.host; }


0

currently I have an enterprise wiki page that is like what you wanted. I will describe the steps I took and hopefully it will help you. Create a subsite that has an "Enterprise Wiki" template. This can be selected in the "Template Selection", under the "Publishing" tab. a. If the "Publishing" tab is not found, go to the main/parent site, under "Site ...


0

Felt my way around this issue and found out that retrieving what I wanted was a bit similar to getting items from a list. This is very simple and I consider it to be a cookie cutter template. Acquiring Client Context came from an other function and will not be displayed. Uri UrltoPicLib = new System.Uri("https://"yourTenant".com/sites/ContentCenter/...


0

Felt my way around this, I found that context.Load(file) , context.ExecuteQuery(), was needed to actually load the file, and then I need to proceed into putting it in a stream which I later turned into a byte array which I was able to convert into base 64. public static void GetImage(ClientContext context, string uri) { try { var files = ...


1

To get the properties of a visual WebPart programmatically, you can refer to the following code for the WebPart at this article. public enum CityEnum { Manila, Berlin, Auckland, Zurich }; public static CityEnum SampleDropDown; [Category("Extended Settings"), Personalizable(PersonalizationScope.Shared), WebBrowsable(true), WebDisplayName("Sample Drop Down"), ...


0

I experienced the same issue and was able to solve it (actually, it's a workaround) with JavaScript. It won't set the flag itself to true but will 'emulate' it. Here is a copy-paste-able code. If you want some explanations, please use the link InplaceSearchEnabled doesn't work when set programmatically in XsltListViewWebPart /// we need to wait until ...


0

You can achieve this by simply add a querystring "Source=" in your survey URL. First, create a thank you page (e.g. /pages/thankyou.aspx). Then, in your survey newform URL (e.g. <site url>/Lists/survey/NewForm.aspx) add the querystring like this: <site url>/Lists/survey/NewForm.aspx?Source=/Pages/thankyou.aspx When the users completed the ...


-1

kindly try below. spUser = spWeb.AllUsers.GetByEmail(txtEmail.Text);


2

To get a SharePoint Choice Field value SPFieldChoice myChoicesfield = (SPFieldChoice)list.Fields["FieldName"]; for (int i = 0; i < myChoicesfield.Choices.Count; i++) { DropDownListName.Items.Add(myChoicesfield.Choices[i].ToString()); } To get a SharePoint Multiple Choice Field value SPFieldMultiChoiceValue ...


1

Make sure you write dropdown change event. Keep autopostback property to true. In dropdown change event of your dropdown write below code. protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = DropDownList4.SelectedItem.Text; } This will show display value of selected choice You can ...


3

From where DropDown1 came? In your code you are adding items in DropDownList4 and you are trying to access the value from DropDown1. Your code should be like: string selectedvalyear = Convert.ToString(DropDownList4.SelectedItem); Label1.Text = selectedvalyear; If you want to change the value of Lable1 from dropdown every time when you change item, then ...


2

Because you have called the Response.End(), which ends the page execution, the body onload event would never be fired. The problem is sharepoint catches form submits and downloads so you cannot double click a button. I had same issue, adding below script on aspx page helped me to resolve it <script type='text/javascript'> _spOriginalFormAction = ...


0

Try updating the file in addition to the SPListItem: targetDoc.Update() targetDoc.File.Update()


2

It is SharePoint which displays your value as a DropDown/Select. The Field value in the SQL database is stored as a String (with only the selected value). When you export to Excel it exports values, not SharePoint functionality


-1

Try to put your button in ajax updatepanel to disallow page refresh


0

List<ListItemCollection> lst = new List<ListItemCollection>(); ListItemCollection lst1 =GetQuery(...); ListItemCollection lst2 = GetQuery(...); ListItemCollection lst3 = new ListItemCollection(); lst.Add(lst1); lst.Add(lst1); foreach (ListItemCollection item in lst) { foreach (...


0

First, confirm that the field is actually among the list item's fields. $sourceItem.Fields | select InternalName, StaticName | sort StaticName | ft -AutoSize There's a possibility that the field, though attached to the list, has not been added to the content type of the list item. Second, when using bracket notation to access an item's fields, you can ...


1

You can try DateTime enddate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day); DateTime startDate = enddate.AddDays(-7); query.Query = "<Where>" + "<And>" + "<Eq><FieldRef Name='Kompania' /><Value Type='Text'>" + ...


2

In CAML Query you should use field internal name instead of Display Name. You can get the internal name for a column by browsing to the List Settings > Edit Column and look at the QueryString value Field.


0

$newItem.UpdateOverwriteVersion() May be what you're looking for. If necessary you can also use $newItem["Modified"] = $sourceItem["Modified"]


2

One option would be to convert search value (SPKeyValue type) into choice field value (collection(Edm.string) type) once the search results are returned. JavaScript example function castToChoiceValue(searchValue) { if (searchValue.Key == "MultiChoiceField") { var value = { "__metadata": { "type": "Collection(Edm....


1

Try this code. Added some safe checks void ddCarNumber_TextChanged(object sender, EventArgs e) { try { SPWeb myWEB = SPContext.Current.Web; SPList myList = myWEB.Lists.TryGetList("WayBill"); if(myList != null) { SPQuery myQuery = new SPQuery(); myQuery.Query = @"<OrderBy> ...


1

Try this below method: void ddCarNumber_TextChanged(object sender, EventArgs e) { try { SPWeb myWEB = SPContext.Current.Web; SPList myList = myWEB.Lists["WayBill"]; SPQuery myQuery = new SPQuery(); myQuery.Query = "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq&...


2

Can you try putting <RowLimit>1</RowLimit> in the Query. The row limit will return only the one last item.


2

Here string myEndMil = myItemCol[0]["endMil"].ToString(); you are assuming you have gotten at least one result back. That might not be the case! You should check first that myItemCol.Count > 0 There is another possible issue at the same line (string myEndMil = myItemCol[0]["endMil"].ToString();) You are requesting a column endMil that you might not ...


0

Simply, check if properties.BeforeUrl contains a dot (dots are not allowed in folder names): string url = properties.BeforeUrl; if (url .Contains(".")) //it is a file * not a folder { //To do }


0

In here private void GetNode(string reportsTo) { SPListItemCollection itemCol = GetListItems(listName, reportsTo); foreach (SPListItem item in itemCol) { //create a new row sAllNewRows += createNewRow(item); //Recursion GetNode(item["Name"].ToString()); } } You should ...


0

The old ‘Open Library in Explorer View’ option in SharePoint may get you out of trouble if the directory structure and number of files is fairly small. Simply use the Explorer View to open the SharePoint library up in a Windows Explorer window and then copy/paste or drag/drop into the Window and the magic will start to happen. If you want to move ...


0

You need to change these lines SPQuery objQuery = new SPQuery(); objQuery.ViewFields = string.Format(DROPDOWNLIBRARY_FIELDS, "AGENTID_FIELD","ID_FIELD", "CREATED_FIELD","SALES_FIELD", "SUBMITTEDDATE_FIELD"); ... DataTable fSDataTable = List.GetItems(objQuery).GetDataTable(); With below code SPQuery query = new SPQuery(); string[] viewFields = new ...


0

Roshan, I was reviewing the code which you have shared, there is a line where you need to do the modification. The below code is in the solution you posted, you need to change the ".xls" to ".xlsx" from the excelFilename with Path. This should resolve the issue with Excel version you are having. string excelFileName = string.Format(@"D:\SPListData\...


0

Finally I found the reason The file.Length property is available only on SP 2013 site. When I tried to run my application on SP 2010 site I am getting the exception because the SP 2010 doesn't have file.Length property Refer:File Properties - SharePoint 2010


1

There are many options to do it. Like SharePoint Designer Workflow Remote Event recievers JavaScript For your requirement follow the steps below, Step 1: Set Up the Visual Studio 2010 Project for the ECB Menu Item Solution Step 2: Create the Edit Control Block Menu Item Step 3: Create a Web Application Page to Start Conversions Step 4: Embed the code ...



Top 50 recent answers are included