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

I need to get all files and file properties from a document library using javaScript

$
0
0

Below is my code. I am able to get the file name and modified date.. I need to get the files' paths, the modified by field, and files metadata (some of which are lookup fields).

var ListName = 'My Documents';
            var ctx = SP.ClientContext.get_current();
            var list = ctx.get_web().get_lists().getByTitle(ListName);                              
            var caml = SP.CamlQuery.createAllItemsQuery();
            caml.set_viewXml("<View><Query></Query><RowLimit>500</RowLimit></View>");
           allitems = list.getItems(caml);
            ctx.load(allitems);
            
            ctx.executeQueryAsync(Function.createDelegate(this, this.onDocumentsSucceededCallback), Function.createDelegate(this, this.onDocumentsFailedCallback));

function onDocumentsSucceededCallback(sender, args) { 

var ListEnumerator = this.allitems.getEnumerator();

while (ListEnumerator.moveNext()) {
               alert('items are being picked up');
                var listItem = ListEnumerator.get_current();
               //  alert('file name is: '); alert(listItem.get_item().get_file());
               //  var file = listItem.get_file();
                 alert(listItem.get_item('FileLeafRef'));
               // alert(listItem.get_item('Modified'));
              // alert(listItem.get_item('Modified By'));

}
}


faye fouladi



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!


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

Get folder by Unique Id not working REST API

$
0
0

Hi all,

I checked around about API for getting folder detail by Unique Id on SharePoint Stack Exchange and API get all document in a folder by folder Unique Id, 

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.

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

Modern Carousel customization

$
0
0
Modern Carousel requirement in Modern Site, is there any built in web part can achieve this ? Or need to customize with SPFX ?

REST API to get current value in a multi-line text field with "Append changes to existing text" option on returns null

$
0
0

Hi,

as to the title,  I'm trying to read the current value in a multi-line text field. and "Append changes to existing text" option is turned on for this field. I am using REST API like this: http://url/_api/web/lists/getbytitle('RESectionFeedback')/Items but it gives me null values for this particular field. 

This is how the item with some values look like if I check it in SharePoint site, as you can see there are some records in feedbackContent field. 

But this is the result returned from the rest api, as you can see the feedbackContent field shows null,

I have searched around and found that I can use SPServices lib to get full list of versions for such field, but I don't really need the full version history but just need to current value, so it might be an overkill and cause some overheads. So I'd like to know if it's possible to get the current value using rest api and I just did not use it correctly, or it's just not possible.

Thanks,

Michael


I have 2 call out functions but if click icon1 or icon2 showing popup in SPFX react webpart

$
0
0
I have 2 callouts  in my SPFX react webpart . 

I added the 2 icons but whenever i click Icon1 initially callout showing near to Icon1 then later its moving to Icon2 place as shown in the below picture.



Multiple CallOut in React SPFX webpart

$
0
0

I want create the 4 CallOuts in SPFX react webpart. The CallOut will open up whenever the user click on the icon marked in red circle in the below image. The CallOut should comeout always beside the icon if the user moves page up and click on icon or page down and click on icon . The CallOut always shows beside the click icon.

 

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

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 ?

Calculated Column CSOM Get Option

$
0
0

I have Server Side Object Model code for getting the Calculated Column.

    SPFieldCalculated cf = (SPFieldCalculated)item.Fields["Down Time Duration"];
    req.DownTimeDuration = cf.GetFieldValueAsText(item["Down Time Duration"]);

What is the equivalent code in CSOM  for getting the value of Calculated Column ?

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!


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!

UPDATE: Still haven't got it working! But I can retrieve the attachment of an already created item with an attachment using:

let item = pnp.sp.web.lists.getByTitle("MyList").items.getById(1);

// get all the attachments
item.attachmentFiles.get().then(v => {

    console.log(v);
});

If I wanted to submit an attachment, I would somehow need to store it in state, then use:

let item = pnp.sp.web.lists.getByTitle("MyList").items.getById(1);

item.attachmentFiles.add("file2.txt", "Here is my content").then(v => {

    console.log(v);
});

But I don't understand how I would store it in state (I guess an array?) then how would I pass it to:

item.attachmentFiles.add(state here?).then(v => {what here?}});

C



Entity Framework 5.0 and SharePoint 2013

$
0
0

Hello:

I implemented a WCF service which utilizes EF 5.0 to return a custom object with information pulled from database. I deployed this WCF service into ISAPI folder. When I invoke this service, it returns below error:

WCF project is set to .NET Framework 4.5

Error=Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.  Server stack trace:     
 at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)    
 at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)    
 at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)    
 at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)    
 at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown
 at [0]:     

Do I need to install EF on the server to be able to utilize it? Could you please provide pointers?

Thanks


How to show the List items attachment like as slide with details

$
0
0

Hi,

I have created one list for registrations ..all  the users are register with his attachment(photo)..Now i want to show this attachment preview and details of users. Examples: I have register with my name and and designation and skills and uploaded my photo.

how to view my details like as below. Is it possible in share point 2013 custom list.

Adding content into CallOut in SPFX react webpart

$
0
0

I want to add the content into my CallOut in my SPFX react webpart The look and feel should be similar to below.

My Code:

<div id="icon1"  className={styles2.IconArea} ref={menuButton1 => (this._menuButtonElement = menuButton1)}><Icon  iconName='Info' onClick={e => this._onShowMenuClicked(e.currentTarget.title)} title="icon1"/></div> 
 {this.state.isCalloutVisible && (<Callout
            className={styles2.callout}
            ariaLabelledBy={this._labelId}
            ariaDescribedBy={this._descriptionId}
            role="alertdialog"
            gapSpace={0}
            directionalHint={DirectionalHint.rightCenter}
            target={this._menuButtonElement}
            onDismiss={this._onCalloutDismiss}
            setInitialFocus={true}><div className={styles2.header}><p className={styles2.title} id={this._labelId}>
                {this.state.calloutTitle}</p></div><div className={styles2.inner}><p className={styles2.subtext} id={this._descriptionId}>
                {this.state.calloutContent}</p><p className={styles2.subtext} id={this._descriptionId}>
                {this.state.calloutContent}</p><div className={styles2.actions}>         <div dangerouslySetInnerHTML={{__html: this.state.calloutLink}} /></div></div></Callout>
        )}    

private _onShowMenuClicked= (title:any): void =>{
  this._menuButtonElement=document.getElementById(title);
    this.setState({
      isCalloutVisible: !this.state.isCalloutVisible,
      calloutTitle:"My CallOut 1",
      calloutContent:"<b>My CallOut Content 1</b> ",
      calloutLink:"<a href='http://bing.com'>Go to Bing1</a>",
    });
  };     

How to show look up fields data into list/view, ,which has no direclty relationship ( below schema is atttached )

$
0
0

Hi,

Noted: Data is already entered into lists

Requirements:

I have a custom list ( name  of list is "packsizedetails") which shows details records of its master (name of master list "Product"). On product list , there are 2 lookup fields,I want to show these look up fields on "Packsizedetails"

Lookup list name 1) Country 2) product Category

how can I  show 'country' and "poduct catergy" data on "Packsizedetails which has no directly link with it.?

Below see the schema Diagram Below


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

Viewing all 7589 articles
Browse latest View live


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