Tag Info

Hot answers tagged

7

Any kind of hardcoded path is, in general, opposite from best practice so opening a SPWeb or SPList object directly from its full server URL is a no-no. To get the SPWeb object, if you are sure your code will always run in your desired web it is perfectly okay to use SPContext.Current.Web. In all other cases, you might want to look at something like the ...


5

It depends on the "context". In a web part or application page, use SPContext. A lot of example code you see on the web uses a console app for simplicity - these would use the SPSite constructor with a string parameter representing the url. In a Feature receiver you'd use (SPWeb)properties.Feature.Parent. Bottom line is, if the code is being executed ...


3

All the customizations proposed below will take no more than 5 minutes to implement once you know what to do. SharePoint is flexible, though not very user friendly, and sometimes it's just hard to find the correct button or menu item... Also one more thing: as I understood from your comments, you don't know SharePoint well, so I tried to make the answer as ...


3

I had a similar issue this morning, with an external dataset with around 100,000 records. The way I worked around it was to create a SQL stored procedure to do the Read List operation, rather than querying the data directly. The Read Item operation can still be linked directly to the list, rather than requiring a second stored procedure. On the Read List ...


2

There are plenty of choices when it comes to bringing business data into SharePoint. 1. Business Connectivity Services This is recommended and the most legal way. Just create a web service and attach an external content type to it. Also you can use direct connection to a database. You can find a comprehensive article about BCS in MSDN Magazine: ...


2

My suggestion is to you can do with string format like this... string DateWithHours = String.Format("{0:yyyy-MM-dd H}", yourDateParameter); if you round hours then u can manually check by extract minute part from date. if minute is > 30 then add 1 hour to date.. For more details see these links... http://www.csharp-examples.net/string-format-datetime/ ...


2

I had the same issue. My first try was to create an additional Read List operation without the Wildcard filter. I set that as default Read List operation, and created a list based on this. That worked, but my picker in for instance External Columns no longer had my wildcard filter. I then sat my first Read List operation (with the wildcard filter) back ...


1

What John said is true. You ought not directly interact with the SharePoint databases. However, when you state "Now I was asked to have all the data available in a 2007 Sharepoint Server" what it sounds like you actually need here is the Business Data Catalog service available in SharePoint 2007. It allows you to surface and interact with the data in your ...


1

connect to another library in sharepoint 2010 does not exist, they for some reason removed it. But I did find another method being used using sharepoint designer...I dont know if it would be any use to you ;) http://www.youtube.com/watch?v=0SfpgoEUlIw hope it helps :)


1

Yes you need to read infopath xml forms using powershell and pick up the fields you are interested in and then write each form as a CSV record. Useful resources, To Read contents of XML, [xml]$books = Get-Content C:\fso\Books.XML $books.catalog.book.title source And the build the contents in a string. Once you finish the XMl record then write it the ...


1

I do this by having a status field associated with the form. With a form submit action, I set this field to submitted. Then on the fields, I have formatting rules that if the status field is submitted, the fields are read only.


1

Research "Creating an external list using BCS" to see if this will work for you. It should as external lists can provide read/write access to external content types, including a SQL Server database table. There are numerous examples on the web and plenty of Microsoft documentation on this topic. Many of the web examples show exactly that scenario, creating ...


1

I figured out I needed to change up the URL parameters a bit up to var url = 'http://portal.internal.urs.org/tools_services/training_library/_vti_bin/listdata.svc/Book?$expand=CheckedOutTo'; I was not joining the two tables correctly, and also reference it by book.CheckedOutTo.Name


1

BCS. The item throttle applies to a single query operation. So, in your BCS model, be sure to include filters on the appropriate columns. These filters will show in the Entity Picker (the button on the list form that looks kind of like the people picker). You won't necessarily get an autocomplete experience like the Bing/Google search box, but your users ...


1

In SharePoint 2013, you have newly introduced Client Side Rendering / JSLink property in Web Parts which you can use to customize the look and feel of List View Web Part.. Please have a look at below examples: Client-side rendering (JS Link) code samples JS Link for SharePoint 2013 Web Parts–A Quick Functional Primer Using JSLink to change the UI of a ...


1

I had a similar requirement and ended up creating a linked server in Sql Server, linked to the DB2, and a "bridge" DB in Sql Server that gets data from the linked server, by exposing it through a view. Then in SP Designer, I created a data source (or BCS external content type) connected to the DB in Sql Server. Hope this helps


1

You must change your query to: "<Where><Eq><FieldRef Name='User' />"+ "<Value Type='User'>"+ currentUser.LoginName +"</Value></Eq></Where>" See the link for details


1

When you map your list to the network drive you loose the SharePoint information like the unique id. I would suggest that you iterate over the list directly, grab the id and store it in the csv. One question: Is the unique id consistent even after your migration?


1

.Net doesn't have a type for only date without time, but you can get a DateTime with no time set from any DateTime by accessing it's Date property. If you want to "round" it to the next day if past noon then add 12 hours before getting Date.


1

In case you're still looking for a resolution for this I do something similar. I have a multi-select column in a custom list and I need to display rows from a different list that match. The difference to your scenario is that I use an InfoPath form for the user's selection. Then I have a DVWP beneath the ListView that has data source connections to both ...


1

this is the difference. ToUniversalTime does: return TimeZoneInfo.ConvertTimeToUtc(this, TimeZoneInfoOptions.NoThrowOnInvalidTime); Instead ToLocalTime does: if (this.Kind == DateTimeKind.Local) return this; bool isDaylightSavings = false; bool isAmbiguousLocalDst = false; long ticks = this.Ticks + TimeZoneInfo.GetUtcOffsetFromUtc(this, ...


1

Try using the PropertyBag associated with the WebApplication object.


1

Unfortunately the database model for SharePoint dont have foreign keys, so using ER tools like TOAD Data Modeller and Rational Rose to the database and generate charts is not very useful since you dont get the relations.


1

I'm assuming the application will be running either under some person's ID, or an ID will be created just for that job. In either case, you'll have some ID that you can ensure has permission to access the file so that the job can access the file. For check in/check out, it could just be disabled entirely. I know when I have document libraries that are ...


1

You can accomplish this in several ways depending on the amount of data that you need to share. The basic idea would be to have a central repository on which the web parts can read and write data. Use a Custom List within the site to be read and updated. Custom SQL database. Use Property bags in SharePoint - Read this blog for detailed info.


1

What about storing it in a cookie?


1

In the lack of more details concerning the possibilities would work for you (e.g. looking at custom development or a no-code solution), i would the easiest is to use the BDC via SharePoint Designer to load from external source according to your schema. The major point here is what possibilities you have: could you bulk-export to some data store accessible by ...


1

Microsoft only mentions in the software boundaries and limits specification for SharePoint that this column can be added 96 times to a SharePoint List or Library (SP2013 and SP2010).This is the only restriction that's available from Microsoft about this column: http://technet.microsoft.com/en-us/library/cc262787.aspx Otherwise you would need to test it on ...


1

Usually it is suggested to use dedicated accounts for each application. There are pros amd cons in that of course, having dedicated accounts provides more security but adds a bit of maintenance. You should take a look at Secure Store, it might be exactly what you want - if you don't want to create new AD account.



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