Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 25064 articles
Browse latest View live

Code to show full Breadcrumb Navigation

$
0
0

Hi,

By default, the title breadcrumb navigation in SharePoint document libraries only shows 2 levels of navigation. When you go down to a 3rd level, for example, Document Library Home > Folder 1 > Folder 2, the breadcrumb at the top of the page shows Folder 1 > Folder 2.

I would like to add code into a CEWP on the page that changes this behavior to show the full navigation path back to the main document library page, no matter how many folders deep I'm in.

I searched everywhere online, found a few custom solutions, but they create their own breadcrumb from scratch and ignore the one that's there by default and have other odd quirks and issues. I would like to update the breadcrumb already available rather than creating a new one.

The closest thread in this forum I could find was this one: https://social.msdn.microsoft.com/Forums/SECURITY/en-US/ac5808e7-49f2-4251-b7f4-26f16abc788d/sptitlebreadcrumb-show-full-path-except-root-node-without-truncation?forum=sharepointdevelopment.

One of the responses in the thread has a screenshot of the navigation exactly how I'd like it to look, with the Document Library and all folders displayed to the right of it, but I'm not clear about the solution to achieve this. Ideally I would like to deploy the solution in a CEWP, not a master page.

Thanks in advance for your help!



spfx -DataTable HyperLinks

$
0
0

Hi ALl,

I am using Jquery Datatable to display items in web-part. 

I have 3 columns that I am rendering, One is Url. Is it possible to have URl Link clickable. 

https://datatables.net/reference/option/columns.render

      $('#example').DataTable( {  
                    data: jsonArray,  
                    columns: [  
                        { title: "Site Url"},  
                        { title: "UserName" },
                        {title:"Status"}
                       ]  
                } );  
$('#example').dataTable( {"columnDefs": [ {"targets": 0,"data": "download_link","render": function ( data, type, row, meta ) {
      return '<a href="'+data+'">Download</a>';
    }
  } ]
} );

The top is example am looking. 

Thanks


Abenet

Update data for Peoplepicker value using REST and Javascript model

$
0
0

HI.

I have a custom list having 2000+ entries. In the list I have a people picker and based on people picker data, the job title of the user is set in a single line text column.

I am trying to update the data in the list, based on role changes for people whose status is "Set On" . Is this correct ?

<script src="/sites/SiteAssets/Jquery/jquery-1.11.3.min.js"></script><script src="/sites/SiteAssets/Jquery/jquery.SPServices.min.js"></script><script type="text/javascript">
	$(document).ready(function() {
var siteURL = _spPageContextInfo.webAbsoluteUrl;
var controlName 	= "Users ID";
var destlistname = "my%20Actions%20tracker"
 var resurl1 = siteURL + "/_api/web/lists/getbytitle('" + destlistname + "')/items?$filter=Resource_Status eq '" + Set On + "'";
$.ajax({
url: resurl1,
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },

success: function (data) {	 	 
var items = data.d.results;
if(items.length > 0){

for (i = 0; i < items.length; i++) {										  var ppDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");	

 var ppEditor = ppDiv.find("[title='" + controlName + "']");	

 var spPP 	= SPClientPeoplePicker.SPClientPeoplePickerDict[ppDiv[0].id];

if (!spPP.HasInputError) 
{
var userKeys = spPP.GetAllUserInfo();
														var myUser = userKeys[0];										var textValue = userKeys[0].EntityData.Title;								findFormFieldTd('Career level').find("input").val(textValue);
	}
	}
	}
else
{
}
},
	error: function (data) {
alert(data.responseText);		
}
	});
function findFormFieldTd(columnName) {
            var thisFormBody;
            // There's no easy way to find one of these columns; we'll look for the comment with the columnName
            var searchText = RegExp("FieldName=\"" + columnName.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + "\"", "gi");
            // Loop through all of the ms-formbody table cells
            $("td.ms-formbody, td.ms-formbodysurvey").each(function () {
                // Check for the right comment
                if (searchText.test($(this).html())) {
                    thisFormBody = $(this);
                    // Found it, so we're done
                    return false;
                }
            });
            return thisFormBody;
        }
});</script>

Thanks

JQuery Data table

$
0
0

In Jquery  Table 

we have 3 columns view : EmpName, EmpAddress, EmpNo

but when we click export yo excel we should get 1 more extra column in excel i.e. Emp. City

How can we achieve in Jquery Data table as view and excel content is not same. 

And i dont prefer Custom Excel , i want use JQuery inbuilt export to excel functionality 

Data will come from  SharePoint List : List Name EmpDetails

Coloumn Name :EmpName, EmpAddress, EmpNo.



Shiv Sharma

Hide select dropdown option for specific group user

$
0
0

Hi Experts,

In List New form, want to hide select dropdown option for specific group user, I don't want to delete the option, just want to hide.

Please suggest a valid soluition

JQuery Data table with Date Range Filter

$
0
0

JQuery Data table with Date Range Filter (StartDate & EndDate)

Where all the data will come from SharePoint list :

Coloumn name are Start Date , EndDate (Date Range)

Other COloumn EmpNAme, EmpAddress, EmpNo

List Name-EMpDetails


Shiv Sharma

Get folder by Unique Id not working REST API

$
0
0

Hi all,

I checked around about API for getting folder by Unique Id on SharePoint Stack Exchange

And Result is : REST endpoint: /_api/web/GetFolderById('<folder unique id>')

But when I test this API on Postman, it not working well.

Have any meet this solution. Please help me.

REST get all folders

REST get FOLDER Detail

How to filter to get the files in a specific folder path using Rest

$
0
0

Hi Experts,

I want to  filter path to get the files in a specific folder path using Rest API, is this possible ?

Thanks in advance

Any help is welcome.


EML & MSG content attachment

$
0
0
I've ".eml & .msg" content as an attachment in my SharePoint list. When I clicking on".msg" attachment, the popup is getting open with the option of"Open, Save, Cancel" where as if I  open ".eml" attachment, the popup is getting open with the option of"Save, Cancel".  Why the "Open" option is not coming when I open ".eml" attachment in SharePoint list? Can you please help me on this?

How to add a file upload button or general feature on spfx web part.

$
0
0

I've been looking for a simple way to add a file upload button or feature that allows the user to upload a doc to a list, (not a lib).

The problem is that most tutorials say how to upload to a doc lib not a list.

I am developing a web part form which allows the user to attach a doc to the form then submit it.

I've looked at the pnp/sp option but I don't understand how to use it.

https://github.com/SharePoint/PnP-JS-Core/wiki/Working-With:-Attachments

How would I use the code with a button to upload? Bearing in mind that the list item does not exist at this point! So there is no ID that the item can attach itself to.

I hope someone understands this!

C

SchemaXML vs CSOM - update

$
0
0

Hello,

I faced problem with change SchemaXML of ManageMetadata (taxonomy) field using CSOM. During run I not receive any errors so investigation is very hard...

Because of Manage Metadata Service structure change I need to update SSPID ( so term store ID) inside each taxonomy fields from old SSP ID =>$regex = 'b31429cc-688c-4393-bcb7-b60cf631ca42'  to new SSP ID =>   [string]$abc = "13e722c5-bebe-4801-a6ac-67aa35eba088"

SCRIPT:

$16Hive = "C:\DLLs"

Add-Type -Path "$16Hive\Microsoft.SharePoint.Client.dll"
Add-Type -Path "$16Hive\Microsoft.SharePoint.Client.Runtime.dll"
 
$url = "https://contoso.sharepoint.com/sites/somesite"
$User = "myaccount@contoso.onmicrosoft.com"
$Password = Read-host -Prompt "Please enter your password" -AsSecureString
$officeClientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
$officeClientContext.Credentials = $Creds
return $officeClientContext
 
$logger = new-object System.Text.StringBuilder
function Log($message) {
                Write-Host $message
                [void]$logger.AppendLine($message)
}
 
$web = $officeClientContext.Web
$officeClientContext.Load($web)
$fields = $web.Fields
$officeClientContext.Load($fields)
$officeClientContext.ExecuteQuery()
$corruptedFields = $fields | ? { $_.TypeDisplayName -like "*Managed Metadata*" }
 
Log $("Fix SiteColumns for site: " + $officeClientContext.Url)
foreach($field in $corruptedFields) {
                if ($field.SchemaXml.Contains('SspId')) {
                               $regex = 'b31429cc-688c-4393-bcb7-b60cf631ca42'
                               if ($($field.SchemaXml -match $regex)) {
                                               $matchedValue = $matches.Values
                                               Log $("Change schema " + $matchedValue)
                                               [string]$abc = "13e722c5-bebe-4801-a6ac-67aa35eba088"
                                               $field.SchemaXml = $field.SchemaXml.Replace($matchedValue, $abc)             
                 
                               }
                }
 
                $field.Update()
                $officeClientContext.ExecuteQuery()
}
 

return $logger.ToString()

Thanks for help.



Michal

How to display image to the right of the page's title breadcrumb

$
0
0

Hi all,

I would like to display my company's logo to the right of the title breadcrumb on a page. To add the logo and put it on the right side of the page, I created an image viewer web part and right-aligned the image using the web part settings.

Then, to move the logo up so that it's displayed directly to the right of the title breadcrumb rather than below it, I added a CEWP to the page with the code below setting the margins of the image to negative so that it would move up parallel to the title breadcrumb. But no matter how much I change the margins, -50, -100, etc. the image always displays a bit below the title breadcrumb. The code is definitely working (it moves the image up) but there is some kind of barrier between the body of the page and the title breadcrumb area that the image viewer web part cannot cross.

#MSOZoneCell_WebPartWPQ3 {margin-top: -50px !important}

Is there a way around this? For example rather than adding an image viewer web part, can I add code to display the image right-aligned in the title breadcrumb zone/section? Thank you as always for your help guys, this forum is the best!


Maximum List Items returned by REST API

$
0
0

Hi everyone,

Have any link Guide desc about Max response item returned from API.

I checked around but still not find link desc clear about it.

Please help me if you have any info related?

Thank a lot,

Danh


Rest API Filtering Sorting condition

$
0
0

Data is fetching from SharePoint list in a Jquery data table 

Rest API Filtering Sorting conditions required:
Condition 1- Sort by created first
Condition 2- Same city data will show together i.e.

Column Name for city sorting is City   


Shiv Sharma

Sharepoint on premises 2016

$
0
0

Two versions are getting created when we create a document with mandatory properties.This happening only in Sharepoint Onpremises 2016 when we are trying to create a document with mandatory property else we are having only one version.We are using rest services of sharepoint, The same rest services are been used for sharepoint online 2016 which is working as expected(only one version is been created, while trying to upload document with mandatory property)

below are the steps we have followed.

Below are the steps while creating the document.

Step 1: Add file to folder./_api/web/GetFolderById('" + folderguid/_api/web/GetFolderById('" + folderguid + "')/Files/add(url='" + fileName + "',overwrite=true)

Step 2:StartUpload using guid generated from step 1 . "/_api/web/GetFileById('" + currObjGUID + "')/startUpload('" + currObjGUID + "')

Step 3:Continue upload till you reach end of chuncks. /_api/web/GetFileById('" + currObjGUID + "')/continueUpload(uploadId=guid'"/_api/web/GetFileById('"+ currObjGUID + "')/continueUpload(uploadId=guid'" + currObjGUID + "',fileOffset=" + uploadedDataLength + ")

Step 4:Finishupload to commit the content. /_api/web/GetFileById('" + currObjGUID/_api/web/GetFileById('" + currObjGUID + "')/finishUpload(uploadId=guid'"+ currObjGUID + "',fileOffset=" + uploadedDataLength + ")

we are getting two versions of document while we are trying to finish upload.this is the mandatory call we have to make to flush the content.(in all the steps above we are using same session Id)2nd version is created immediately once step 4 is executed and 1st version size remains 0

 


SharePoint Rest API Returen wrong date

$
0
0

Hi,

I found in Rest Response, date field return the wrong value, it will have some hours ahead from my real time.

Did I miss some settings in my side ?

How to fixed heder of view

$
0
0

Hi,

I am using view with filter and groups, working fine everyting.Need to know 2 things

1) just fixed the header of view so if user goes below, header will be available so as to user can reactify data easily by Column name.

2) how to show meta data navigation on right side as I have placed my own menu on right side.

Have a look snap shot

Powershell command to get list of all subsites under sitecollection in Sharepoint 2013

$
0
0

Hi!!

We would like to get list of all sites and subsites under a site collection and also its modified by and last modified dates of all documents in a document library and lists and versioning details using powershell commands. 

Can someone help me on this?

Regards,

Susmitha.




Uploading large file Rest API

$
0
0

I'm trying to upload a large file about 800MB to a library with Rest.

But I'm getting Request Time out error.

Is there any valid solution for large file upload ?

User with full control getting access denied error on permission page

$
0
0

Hi All,

Users who are in "Owner" group are getting access denied error on site permission page, list/library permission page in SharePoint 2013. This is happening in one site collection only, other site collections under same web are not affected. Could not reproduce this neither have solution for this.

Please advise.

Viewing all 25064 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>