Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

For your requirements, you can use Timeline webpart in SharePoint 2013. Follow below steps: Add a page(or use existing). Edit your page. Add new timeline webpart from content rollup category. Configure data source to your task list. Reference: Timeline Webpart in SharePoint 2013


0

You say that the Minimal Download Strategy feature is enabled on the site, and I'm guessing that's where the problem is coming from. With MDS enabled, the MDS engine tracks which resources have already been loaded by the browser, like Javascript and CSS files. If something is determined to have been loaded already, MDS will prevent it from being reloaded ...


1

You can extract Display Name from people picker element by following statement. var employeeName = SPClientPeoplePicker.SPClientPeoplePickerDict["EmployeeName_TopSpan"].GetAllUserInfo()[0].DisplayText Please note: "EmployeeName" here in "EmployeeName_TopSpan" is the people picker div element id and assuming that people picker will have only entry ...


0

If I am not wrong, you want to call the isMember function twice and parallely. After both call executes, you want to check if user's membership. Solution: If you are using jQuery: You can use jQuery.when(). Reference: jQuery.when() If you are using Angular JS: You can use $q.all(). Reference: $q.all()


1

We can use REST API to get list items, then using jQuery datatable to show the items. The example code below for your reference. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables....


0

How are you getting the code to kick off? $(document).ready(function(){<code here>});? It's possible that the token needed for a rest call hasn't been generated yet when the code runs, causing it to not kick off properly. Are you receiving any errors in the error callback?


1

You are making the wrong API call. You should instead use /_api/SP.UserProfiles.PeopleManager/GetPropertiesFor See Retrieve userprofiles by REST API for more information.


0

You could use position CSS property with sticky value (doesn't work with IE). You would iterate over the table HTML rows to update row style. However, since it's a table, you need to know which cell refers to the field to freeze. To do so, we will retrieve all our fields index (cells position): var tableFieldsIndex = new Object; // Contains [fieldName] = ...


1

The problem you are having is because you are closing the window before the async operation has finished. Closing the window in btnSave_Click while an async operation is potentially in progress is very dangerous in general, and that danger is being exposed by the cold start, but you could have intermittent problems with that code even without the cold ...


1

Please try below code after attaching jQuery library on page. $(function(){ $.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + "/_api/site/usage", type: "GET", headers: { "Accept": "application/json;odata=verbose", }, success: function (data) { var percent = data.d.Usage....


1

The round-trip synchronization was offered by Microsoft a while ago and they stopped it with Office 2010. The Microsoft Excel 2007 add-in mentioned by Susan works even with recent versions of Excel, but it requires to start from an Excel file, and it creates a new SharePoint list. You can't use it to sync with Excel an existing SharePoint list. If you want ...


1

This feature is not currently out-of-the-box and never was. The natural flow of update/refresh is from SharePoint to a local excel spreadsheet born out of the natural export feature and not the other way around. The closest thing was available a long time ago by adding an add-in to Excel 2007 (tested and verified in sharepoint on prem 2007 and 2010 by me). ...


0

You can create a list named logs, and you can add to it a new item every time a user is viewing your specified document. Creating a new item you can achieve by javascript REST call: // item = { __metadata: {type: SP.Data.xxxListItem }, ....} PostListItem = function (listName, item) { return jQuery.ajax({ url: encodeURI(_spPageContextInfo....


0

you can achieve the validation for People Picker field through the following code <script type="text/javascript"> function PreSaveAction() { //assign value of people picker field to variable var AssignedTo = "Assigned To"; Assigned = SPClientPeoplePicker.SPClientPeoplePickerDict[$('[title="' + AssignedTo + '"]')[0].id]; //...


0

Try this. Create a HTML file and JS file. Upload JS file inside sharepoint get the link of JS and append it to HTML file and then upload the HTML to your sharepoint Get the URL of the html and put inside your CEWP and then try debugging. Let me know if not working.


0

The ctag is added for cache busting. If you change the source file, the ctag will change, thus the URL changes so the browser will not load an older cached version of the source file. But anything that is added to the URL after the question mark (i.e. parameters) does not affect the loading of the source file by the browser. If you're JavaScript is not ...


1

This has now been resolved after 5 days. I can only assume that Microsoft have noticed the error themselves.


0

If I understand correctly, you are populating a form with values from the Questions list, and then you want to record the responses in another list, including Student ID. First I would ask if there is a specific reason you are creating the form from scratch instead of using a more "out of the box" solution. For example, you could use the built-in "Survey"...


0

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { SP.SOD.registerSod("Your javascript file name i.e xye.js", "Your js file path i.e /Style Library/xyz.js"); SP.SOD.executeFunc("Your javascript file name i.e xye.js", null, null); ExecuteOrDelayUntilScriptLoaded(function () { //Your function to execute //In your case ...


2

We can add the code below into a script editor web part in task list form page to achieve it. <script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <script type="text/javascript"> function PreSaveAction(){ var dueDate=$("input[title='Due Date']").val(); if(dueDate.trim()==""){ alert("...


0

The following example code for your reference, modify the "loginName" in the code and add the code into a script editor web part in page. <script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ var loginName="domain\\username"; ...


0

Try to use this REST API endpoint to have all users information: http://<siteUrl>/_api/Web/SiteUserInfoList/items then filter by the field you know and select the information you need ($select=EMail)


0

In my library I created a function that permits to stop a Workflow 2010 : https://aymkdn.github.io/SharepointPlus/lists.html#stopWorkflow This technique uses an iframe to load the workflow page and trigger the "End the workflow" link, so you need to make sure the user has correct permissions, uses a browser and is on the same website (to avoid security ...


0

In your code there is a below line : clientContext.load(oListItem); I cannot see "executeQueryAsync" after this line. You code will not make a call to server just by "clientContext.load(oListItem)". Here you will have to add one more line to make a call to server and get the required data from server. Refer below example : clientContext.load(oListItem);...


0

Unfortunately 2010 Workflows do make a difference. Using "SP.WorkflowServices.WorkflowServicesManager" only works on SP2013 Workflows. From what I understand, there isn't a "Stop Workflow" web service we can hit with 2010 Workflows.


0

Modify the code as below to check if it works. <script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ getSubjects(); }); function getSubjects(){ var namesArray=[]; var optionSelected = $("select[title='Subject'] option:selected")....


0

I'm going to propose a hack, that may or may not work since I have no way to test it myself. As you already pointed it, it's mostly likely related to a change of DOM between IE8 and IE11. Looking at form.js, that createRange is pretty much only called on docEditor.selection, where docEditor is the Document of an RTE. That actually makes sense, because ...


2

I would double check that "Location" is truly the internal name of the field. Sometimes the display name can change, and to register the CSR override you need to use the internal name. The easiest way to check that is to go to the List Settings page for the list, scroll down to the Columns section and click on the name of the column. on the Edit Column ...


0

you can use this snippet <script type="text/javascript" src="yourreferencetojquery"></script> <script type="text/javascript"> $(document).on("click","input[Title='yourfieldtitle']",function() { $(this).val(JSON.parse($("div[dir='none'] div input").val())[0].DisplayText); }); </script> Basically this snippet would copy the ...


0

Here is a way to pull the information from the field after a user has been selected and is in the People Picker field. I use this myself. var myTextField = $("input[id$='myTxtField']").text(); var peoplePicker = $("div[title$='People Picker']"); var peoplePickerValue = peoplePicker[0].innerHTML; if(peoplePickerValue != "") { peoplePicker = ...


0

You could update the single line of text in the list item by adding custom JavaScript code. For more detailed information, refer to the articles below. How to: Create, Update, and Delete List Items Using JavaScript. Insert And Update SharePoint List Using JavaScript. There is a similar post: https://social.msdn.microsoft.com/Forums/office/en-US/e4f27de5-...


2

I'm guessing that the actual name of the column is "Project Manager", and that only through the data that you get from your REST request do you see the column with the internal name appended with "Id". User columns in SharePoint are actually lookup columns to a user list. So in order to get values from the lookup item, you need to use $select and $expand ...


2

It is not possible without using the SharePoint Framework, and even then its not recommended/supported. It's not recommended because the pace of change of Office 365 means that any DOM manipulation of OOB code is likely to be broken at any time by updates from Microsoft. That said, there are 3 ways off the top of my head that you can do this, if you choose ...


0

I was able to get this to work by using the code mentioned here by Mark Rackley, its using REST, easy to setup and works great, hope it helps someone.


0

Not the answer to the question but in case if you want to modify the status of the column ("Hidden","Required"), the below code is useful (Link) string[] ContentTypeColumnNames = new string[] { "Column1", "Column2", "Column3" }; using (ClientContext context = new ClientContext("http://yourSiteAddress")) { List list = context.Web.Lists.GetByTitle("...


0

i assume that view form has ID of request in query string: like this DispForm.aspx?ID=35&Source=... so you can use own function to open New form with your query string for example NewForm.aspx?CopyID=35 In New form there will be function to cheeck if query string CopyID is present and if so, it will load Item with ID=35 from reuqests list and then ...


0

//you can re-iterate inside the success to call the Attachments api //for every item inside the data result of the first out ajax call $.ajax({ url: Siteurl + "/_api/web/lists/getbytitle('" + listname + "')/items" + query, method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { ...


0

If you want to get the attachments for a specific item from the custom list, you need to have the internal ID of the record item. Once you have your ID, you can do a rest call, here the rest URL: /_api/lists/getByTitle('{{ListName}}')/items({{ID}})/AttachmentFiles You just need to pass the List name and the item ID. BR, jasminb


0

You can update your code as follows SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ //your code OnPostRender: function(ctx) { //your code //Add this line of statement to work your customizations on sorting ,searching, filtering ctx.skipNextAnimation = true; } });


0

I just implemented this option for an FAQ list and it worked like magic. The key is to create the JS file and then when you add the webpart to a new page add the link in the JSlink of the webpart. (function () { var overrideCurrentContext = {}; overrideCurrentContext.Templates = {}; overrideCurrentContext.Templates.Header = "<div class='...


0

There is a working solution of this issue in other topic: This is what I used to fix this problem: <SharePoint:ScriptLink Name="MicrosoftAjax.js" runat="server" Defer="False" Localizable="false"/> <SharePoint:ScriptLink Name="SP.core.js" runat="server" Defer="False" Localizable="false"/> <SharePoint:ScriptLink Name="SP.js" runat="server" ...


0

The following example for your reference. 1.Create a custom list, and add lookup column "holiday", number columns "training","vacation" and "totals" into list. 2.Add the following code into script editor web part in new/edit form page. <script src="http://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <script type="...


3

While Joe McShea is correct in that there is no direct "distinct" type of operation through the REST API, as I learned in the answer I accepted to a question I had over on S.O., you can get distinct values through some clever querying. Now, I'm not sure you can do this directly using oData query options (although you might be able to), you could certainly ...


2

No, SharePoint REST/OData has no equivalent select distinct. You can only achieve this by post-processing. Ref: How to get distinct values using Rest Api and bind to html dropdown


0

Better use PreSaveAction . In this function check for: if ($('[id$="_$ClientPeoplePicker_HiddenInput"]').val() != '[]' && $('[id$="_$DateTimeFieldDate"]').val() === "") { return false; } (depending on the number of peolplepickers and date fields in your form you might have to adjust the selectors)


0

You need to add an event listener for triggering the function swap() <i id="rArrow" class="fas fa-arrow-circle-right"></i> let clickEvent= document.getElementById('rArrow'); clickEvent.addEventListener("click", (e: Event) => this.swap()); Trigger the function like this out side of render (): void swap(){ } Let me know if still trouble. ...


Top 50 recent answers are included