Tag Info

New answers tagged

0

i could be wrong here but isnt SPContext.Current null which is correct as there isnt a current context as you havent signed in yet so there isnt one available ;) use: SecurityToken token = SPFormsUserNameSecurityTokenHandler.CreateSecurityToken(formsClaimsAuthenticationProvider.MembershipProvider, formsClaimsAuthenticationProvider.RoleProvider, username, ...


1

I'm just guessing here, but here are some things that I think could help. Add this JavaScript code to the custom sign in page (before your if-statement): SP.SOD.executeFunc('SP.js', 'SP.ClientContext'); You could also add this JavaScript to your page to test if it works or not, using the console: var clientContext = new SP.ClientContext.get_current(); ...


0

Below link will show you the Easiest way for installing and using Dispose checker Tool http://sharepointhangout.com/easy-stepshow-to-use-sharepoint-dispose-checker-tool/ Also there are various reasons for performance issues and larger page load times.Check out the below link to see if you are Implementing all the below mentioned points ...


1

Try this, Test-SPContentDatabase -Name $DbName -WebApplication $urlApp > C:\\TextResults.txt or Test-SPContentDatabase -Name $DbName -WebApplication $urlApp > C:\\TextResults.xml it should create a result file in C drive. Edit Right way, Test-SPContentDatabase -Name $DbName -WebApplication $urlApp | Out-File c:\TestResult.txt Seems like ...


1

You could add PowerShell snap-in in you .ps1 file. But in this case you should have some permissions to sql and SharePoint if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" }


0

A How-To Guide to Make your Custom WebPart a Consumer. I will be using Performance Point Filter as a basis for this Guide. As i am working on 2013, i am unsure if this solution as whole will work with 2010 and pretty sure this will not work with 2007. But will need verification with both types of SharePoint Services. Full Disclosure: Savvy - Query ...


3

Try this SPUserCollection users=web.SiteUsers; SPUser user=users.GetByID(31); SPweb.User return only users who are directly set as user on the web, if someone have access to web because he is in the particular group, this user cannot be found. SPweb.SiteUsers return all users


0

As mentioned in comments for your question. If you call the web service using system account your service updates data also as system account. SharePoint workflows doesn't work correctly with system account. You need to use another account to call you service.


0

I have used code like this successfully SPFolder fldr = web.Folders[strLibraryUrl]; SPFile file = fldr.Files[XMLFileUrl]; XmlDocument xmlDoc = new XmlDocument(); byte[] bites = file.OpenBinary(); Stream strm = new MemoryStream(bites); xmlDoc.Load(strm); // Now you can select nodes, loop, or whatever XmlNodeList nodes = xmlDoc.SelectNodes("Files/File"); ...


0

I think you may be missing the following line: web.AllowUnsafeUpdates = true; Since you are ensuring the user is part of the website and if not, it adds that user to the site, then you need to allow unsafeupdates. Your code should be: web.AllowUnsafeUpdates = true; SPUser user = web.EnsureUser(@"Domain\LoginName"); //do more code stuff ...


0

I suggest check it in PowerShell $web = get-spweb $weburl; $web.siteusers | ft UserLogin, Id; Then try to get that specific user by id $user = $web.siteusers.getbyid(31); $user; If this works in PowerShell, it should work in your managed code. SPUser approver = web.SiteUsers.GetById(31); NOTE: One thing to be aware of is that a users Id will change ...


0

If you have the user's email address, give this method a try: SPUser approver = web.SiteUsers.GetByEmail("approver@domain.se");


1

Try any of the below: web.EnsureUser(@"domain\loginname");//This will add user to site if not already added. //Best to use this if you have the login name and //user is already added. web.SiteUsers.GetByID(31); //This will get you the user by id.


0

Sharepoint 2007 (MOSS) and Sharepoint 2010 are two different environment and for console or other application can't access both these application url from a single box. If you run your program from MOSS environment, you can access the sites that are in SP 2010 and vice versa. So you have to take help of sharepoint web services. Take a look at Migrate ...


0

There are at least 2 more things that you need to take into consideration when using calculated columns with content types: Each column referred to in the calculated column must also be a site column added to the content type - The point here is that you cannot do things like reference a list level column in a content type level column because once you ...


0

Try this snippet, from here: string site = "http://servername/sites/TestSite"; using(SPSite spsite = new SPSite(site)) { using(SPWeb spweb = spsite.OpenWeb()) { SPFile file = spweb.GetFile(strFileURL); StreamReader reader = new StreamReader(file.OpenBinaryStream()); XDocument xdoc = XDocument.Parse(reader.ReadToEnd()); ...


1

Yes and no. First off, in order to develop a SharePoint solution without SharePoint installed, you would have to get a copy of the ISAPI folder from the 15 hive, and you might have to make a registry change. You will not be able to debug, however. You cannot deploy it directly, but you can publish the wsp to your SharePoint Online site, and then activate ...


1

I suggest getting a Developer site on Office365. If you already have a subscription you can create a Developer site collection. You will want to install the NAPA app. From here you can create SharePoint hosted solutions via the Browser IDE. This let's you start playing with SharePoint with very little overhead. There is however a caveat - in that it's a ...


0

I think that you need SharePoint Server or Foundation to use the SharePoint development tools included in Visual Studio. http://msdn.microsoft.com/en-us/library/ee231582.aspx If you are going to develop and App for SharePoint you can use any web server or hosting service (for Provider-hosted app) or Microsoft Azure and SQL Azure (for Autohosted app) so ...


0

That depends on the version of SharePoint you are trying to code against, and what exactly you are trying to accomplish. 2010 and below would require you to have SP installed on the box you are developing on. If, however, you are developing for 2013 you have a bit more flexibility. If you need to create a farm solution, then just like 2010 and below you ...


0

You must install the following prerequisites on the system before you can use the SharePoint solution development tools included in Visual Studio: Visual Studio Professional or an edition of Visual Studio Application Lifecycle Management (ALM). Either the Visual C# or Visual Basic feature, or both, when installing Visual Studio. Microsoft ...


2

With External lists the BDC Identity IS what you want you want in lieu of the traditional list item ID. This is actually in an MSDN reference that I am failing to find to provide a link too. I was still dealing with the problem of each BDC Identity being duplicates - which is why the getSelectedItems was not working. We resolved this by correcting the ...


0

Alex, You should set the control as follow: MyCustomField.ItemFieldValue = "1"; MyCustomField.Field.DefaultValue = "1"; Where 1 is for true, and 0 is for false


0

I found a solution and it's rather simple really... What I had to do: Create a custom view for my list Edit that view to show the Heading and Subheading (it was shown graphically before, but not as "data") Edit the view so it has a really large "limit results" number. I chose 10000 per page for now (otherwise the created xml file doesn't show all data ...


2

You can store them in a custom list.


1

OOTB Alerts does not have the flexibility to be called only when the particular field in list item is changed , rather it will be called when any field in the list item is changed. You can create similar functionality with 2 approaches : Create an Event receiver which will be called on item updating.Compare before properties and after properties value of ...


2

There's nothing OOTB that I know of. I can think of 2 options and they both essentially do the same thing. Customer Event Receiver -- you need to use the ItemUpdating event which isn't overly painful if you're familiar with sharepoint event receivers. This should help -- Item Updating Event Receiver The downfall is now you want to alert someone so you ...


2

you can do Response.Write, or you can use asp:Literal. var ltlCnt = new LiteralControl(); string divStart = @"<div>"; ltlCnt.Text += divStart; string divEnd = @"</div>"; ltlCnt.Text += divEnd; this.[divOnPage].Controls.Add(ltlCnt);


0

If Ferda approach does not work for you there is a way to disable events when updating a value inside of an event receiver. Lots of examples on the web, here are two: http://www.mattjimison.com/blog/2011/05/11/disable-event-receivers-during-an-update/ ...


2

To query any person or group field against logged in user you can use **<UserID/>** tag in Value. if (!Page.IsPostBack) { using (SPSite mySite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb myWeb = mySite.OpenWeb()) { ...


0

A possible scenario, if you need to modify the data source programmatically, would be to create a custom Web Part that inherits from the Chart Web Part. Then you can set the values using the properties from the base class by overriding the binding methods. I would highly recommend first adding a Chart Web Part using the SP User Interface, configuring it and ...


0

See, SP provides List that can be used to store data.. You can retrieve them using Object Model.. SPList.GetItems(SPQuery) (this can be similar to writing SQL Queries).. You might need to learn a little bit of CAML, there are some tools available that prepare the CAML for you (U2U Caml Builder, others search for them).. About people can delete List Items, ...


0

Have you tried the out of the box chart web part? http://office.microsoft.com/en-us/sharepoint-server-help/introduction-to-the-chart-web-part-HA101889216.aspx


1

Versions.GetVersions Method of Versions Web Service could be used for retrieving information about the versions (including comments) of the specified pages. public XmlNode GetVersions ( string fileName ) where filename is site-relative URL of the page Example The following request <?xml version="1.0" encoding="utf-8"?> <soap:Envelope ...


0

You can start a worker process in the activation code that will wait for the web to be provisioned and then remove the permissions you want.


0

Please try the below url its useful : http://www.c-sharpcorner.com/UploadFile/sarav82/MOSS11072007065009AM/MOSS.aspx OR http://spupload.codeplex.com/


1

Farm admin rights are needed to write to config DB whereas app pool account can write to content DB. That means running the code inside RunWithElevatedPrevileges should be able to write to content DB.


0

When you run with elevated privileges it will use the application pool identity. The application pool identity has full access to the web application.So you need to be farm admin to access content db. There is other interesting way to look at your question . Below scenario can be considered The property bags are stored under content db. Your current ...


0

There’s two parts to this. Both the ability to save, store, the information as well as being able to later review the information in central admin. Without any detailed knowledge about what type and amount of information you would like to store I would recommend a SharePoint list. Maybe stored in a central site collection or within the central ...


1

The Event Receivers can only be Scope at Site or Web. http://msdn.microsoft.com/en-us/library/office/ms431081(v=office.14).aspx I believe you would need to use a Feature Stapler. For existing sites, you will need to activate the feature manually, either using the UI, or powershell loop that activates the feature everywhere. Then you need a feature ...


0

Yes Ajax CollapsiblePanelExtender is fine to use! iv used it enough times! The people who complain are the ones who dont know how to use it! You can do it through either c# or aspx. But you need to have two Divs, one is the header that the user would click (title) and the other is the body that contains the checkboxes. add your label within the header ...


0

I had a problem like that and I solved with a couple of CSS class and lines of JQuery. For example: <ul class="archive_year"> <li class="years">2012 <ul class="archive_month"> <li class="months">September <ul class="archive_posts"> <li class="posts">Article 1</li> <li ...


1

Instead of using CollapsiblePanelExtender of AJAX, use jQuery as in case of AJAX we need to change web.config and other tweaks. You can use default CollapsablePanel control of Jquery or other plugins available.


1

For some reason the QA environment, the site collection administrator was empty, :(, dont know why, but then it works. Lesson learned


5

If you are working mostly with SP 2013 your life will be much easier. SharePoint has a very robust set of web services as well as a new workflow model that is declarative (not code based) that is designed so that the business logic is moved into external web services. So you could use Java, PHP, Ruby, etc to actually write the parts of your applications that ...


0

In VS2010, you can use optional parameters with .NET 3.5. See this link for solution. Right Click on the project Go to properties Go to Build Tab Click on ‘Andvanced’ Set language version to ‘default’ Save the project


5

Elevated privileges is not enough to write to the configuration database. With elevated privileges you will use the the web application app pool’s identitty, which has only read permission to the config db by default. Of course admin user (which runs the central admin should have read and write permissions). See more at: ...


0

Use a makeCab utility to create one & try to use it. Before that I suggest you to extract a SP 2013 compatible .WSP & see all the artifacts present & whether they match your old .WSP inner files.


1

Here is a snippet of Powershell code that you could run ( I didn't test this ) $siteUrl = "https://yoursite.com" $rootSite = New-Object Microsoft.SharePoint.SPSite($siteUrl) $spWebApp = $rootSite.WebApplication foreach($site in $spWebApp.Sites) { $web = $site.RootWeb write-host $web.Url $folder = $web.GetFolder("\SitePages") ...


1

You can do this completely declaratively with no custom code. Use a module and set the welcome page via a web property: <Module Name="SitePages" Url="Lists/Configuration"> <File Path="SitePages/CustomDefault.aspx" Url="CustomDefault.aspx" Type="GhostableInLibrary" /> </Module> <PropertyBag Url="" ParentType="Folder" ...



Top 50 recent answers are included