Tag Info

Hot answers tagged

4

you can use $().SPServices <script type="text/javascript" src="/sites/sprc/Resources%20%20jQuery/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/sites/sprc/Resources%20%20jQuery/jQuery%20SP%20Services/jquery.SPServices-0.5.4.min.js"></script> <script type="text/javascript"> function StartWorkflow(ItemURL, ...


4

You are missing a couple of rows in a working script. First, after setting the oList variable you need to load it: clientContext.load(oList); Then you need to fetch the value by calling: clientContext.executeQueryAsync( Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed) ); Now, you need to create the ...


1

If your ultimate goal is to get SharePoint list items using JavaScript, then you can refer below set of functions. Also you can refer this useful msdn blog. function getListItems () { try { var clientContext = new SP.ClientContext('http://www.vignesh.cloudappsportal.com'); var oList = ...


1

Look this sample from MSDN. Provider-hosted apps written in JavaScript must use the SP.RequestExecutor cross-domain library to send requests to a SharePoint domain. You can upload files up to 2 GB with the REST API. jQuery(document).ready(function () { // Check for FileReader API (HTML5) support. if (!window.FileReader) { alert('This ...


1

You can use this function: function scriptStart(xSelectedItemId, xSubscriptionId) { //var xSubscriptionId = "{7d028513-b2ea-4ad0-a996-9b807f2beb2e}" console.log("scriptStartWF.js: Ribbonbutton script started, Workflow subscriptionId==" + xSubscriptionId + ", selected Item Id==" + xSelectedItemId) var scriptbase = ...


1

In fact the similar question has already been answered here Below is provided the examples for the case of JSOM API. At least two options are available to determine whether field is system or user-defined Using SourceId property of a Field For system fields it's value is set to http://schemas.microsoft.com/sharepoint/v3 Note: SP.Field object does not ...


1

If it were CSOM, you could check the SourceId property (built-in fields have the value http://schemas.microsoft.com/sharepoint/v3 in it), in order to tell whether a field is a built-in or a custom one, like in the following code snippet: SPListItem item = //some code retrieval var customFields = item.Fields.Cast<SPField>().Where(field => ...


1

Try this var context = new SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle("DocLibrary"); var query = new SP.CamlQuery(); var caml = "<View><Query><OrderBy><FieldRef Name='Modified' Ascending='FALSE' /></OrderBy></Query></View>"; ...


1

I have used the following javascript to set people pickers on new/edit forms in SP2013: First you need to get the loginName for the user, you could extract the ID from the value you got and use it to get the loginName through a REST query: var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; $.ajax({ url : ...


1

Take a look at this link http://sympmarc.com/2012/04/22/working-with-sharepoint-people-pickers-with-jquery-a-new-function-called-findpeoplepicker/ And use following code to set picker value siteContactPeoplePicker = $().findPeoplePicker({ peoplePickerDisplayName: "Site Contact", valueToSet: $().SPServices.SPGetCurrentUser() });


1

You can use ToolTipTitle and  ToolTipDescription of the Button element in custom action.


1

You can access this information via the MajorVersionLimit and MajorWithMinorVersionsLimit properties of the Microsoft.SharePoint.Client.List object. For example (managed OM): string url = "http://yoursite/subweb"; using (var clientContext = new ClientContext(url)) { var web = clientContext.Web; List list = web.Lists.GetByTitle("YourDocLib"); ...


1

The solution I would use instead of populating the options based on the selection would be to create two different fields in a list (meat options and vegetable options). With that you could throw in a simple script on a custom form to show the meat options when the meat radio button is selected and same thing for vegetables. This way all of your ...


1

You can use success handler for reading file content function readFileSuccess(data) { alert(data); } Update var executor = new SP.RequestExecutor(weburl); var info = { url: fileContentUrl, method: "GET", binaryStringResponseBody: true, success: function (data) { //binary data available in data.body var result = ...


1

This is happening because of Minimal Download Strategy, which is by default enabled on SP Online. To make it work, you should use SP.SOD.executeFunc https://msdn.microsoft.com/en-us/library/office/ff409592%28v=office.14%29.aspx This ensures that the specified file that contains the specified function is loaded and then runs the specified callback ...


1

You may put your HTML file and its resources in a basic document Library. In SharePoint, any file can be stored in a doc lib, event HTML code, like HTML pages, CSS files or JavaScript code. SharePoint itself stores (some of) its own aspx, CSS files, etc, in document libraries. Once your files are all in the doc lib, clicking on the HTML file would simply ...


1

Use Iframe and reference the -tag to a url in a document library that contains your files yourhtml.aspx, yourjs.js, yourrcss.css. Get your references to scripts and css correct in yourhtml.aspx. Then just: <iframe src="https://yoursharepointurl.com/documents/yourhtml.aspx"></iframe> Use script editor web part, or content editor pointing to a ...


1

one way for making sure all 3 levels are expanded <script src="https://portal/SiteAssets/jsLibrary/jquery.1.9.1.min.js" type="text/javascript"></script> $(document).ready(function () { // Wait until SP.JS has loaded before calling expandAll ExecuteOrDelayUntilScriptLoaded(expandAll, "sp.js"); }); function expandAll(){ ...



Only top voted, non community-wiki answers of a minimum length are eligible