Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all 8089 articles
Browse latest View live

How to get permission at folder level in SharePoint library folder using SharePoint object model.

$
0
0

Hi,

we have requirement that to generate a report for the SharePoint site which will contain the following information:

Where permissions inheritance are break at which (Library/Folder ) through out the site.

Generate report for a user/AD user/AD group/SPGroup in which Library/Folder/Sub-Folder has rights( read/write etc.)

If the permission is broken at folder/sub folder level till last level of broken information should catch.

------------------------------------------------------------------------------------------------

For getting the information about break inheritance permission at library level we have solution, however to get the permission at folder level/sub-folder level we did not find any direct/indirect approach to to get that and we are not found which folder the inheritance permission is broken.

Could somebody have idea on this? Please help us.

Thanks in Advance !!!

Mrutyunjaya Rath


Provider Hosted Web Forms BoilerPlate Code doesn't work VS2013?

$
0
0

Hi,

I'm struggling to achieve seemingly the most basic thing here and could do with some help getting started....

I have :-

- A SharePoint Online Tenancy with a Dev Site

- Visual Studio 2013

I'm firing up VS2013 and creating a new project - App For SharePoint - which I set to "Provider Hosted" using ACS ... and of type "Web Forms" (rather than MVC).

I set my developer site to that of the one in my tenancy and authenticate to login.

Using the boilerplate code that is generated, I hit F5 and get an immediate fail in the code-behind of the Page_Load on Default.aspx

Object reference not set to an instance of an object ... and the line that fails is the :-

clientContext.Load(clientContext.Web, web => web.Title);

For some reason, clientContext is returned as a NULL from spContext.CreateUserClientContextForSPHost())

Here's the entirety of the code :

 protected void Page_Load(object sender, EventArgs e)
        {
            // The following code gets the client context and Title property by using TokenHelper.
            // To access other properties, the app may need to request permissions on the host web.
            var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);

            using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                    clientContext.Load(clientContext.Web, web => web.Title);
                    clientContext.ExecuteQuery();
                    Response.Write(clientContext.Web.Title);
            }
        }

spContext itself seems to be ok .... but clearly there's an issue with the usertoken.

I've tried modifying the appmanifest to grant permissions to the web ... but it just won't play ball.

Am I missing something fundamentally basic here to be able to debug and run in dev mode ??

I've even gone into the AppRegNew.aspx page in my dev site to register my app and obtain my client id and client secret which I've added to the web.config of my remote app (and the client id into the app manifest) ... but no joy ...


app does not work on a Non-Root Site Collection

$
0
0

I have submitted an app to the store but it failed validation due to "Your  app does not work on a Non-Root Site Collection."

The relevent code is

function CreateQuestionsList() {
    var createListInfo = new SP.ListCreationInformation();
    createListInfo.set_title(questionsListName);
    createListInfo.set_templateType(SP.ListTemplateType.genericList); //list type
    var newList = web.get_lists().add(createListInfo);
    context.load(newList);
    context.executeQueryAsync(CreateQuestionsListSuccess, createQuestionsListFailed);
}

function createQuestionsListFailed() {
    alert('Failed to create the Questions List.');
}

Although it runs fine when I test it, apparently the createQuestionsListFailed function is called when run from a non-root site collection. My problem is that I don't know how to make this happen when I'm testing the app myself so that I can correct it.

Thanks for any help/suggestions.

M.

Create folder within a list via REST API

$
0
0

Hi,

I wanted to create a folder within a simple list by using the SharePoint Online REST API, but was not able yet to do so. I tried a lot of stuff to get it work, but it seems it is simply not possible

Basically I trigger the list by this URL: 

https://<Base URL>/_api/Web/Lists/getByTitle('Custom%20List')/items

and this POST Body:

{ "__metadata":{"type":"SP.Data.Custom_x0020_ListListItem"},"Title":"Test Folder", "ContentTypeId":"0x0120003323C8FB37825245827DCD274481C888"}

This creates a list item in my List 'Custom List' visible as Folder. Its Title is of course Test Folder, but the folder path is not /Custom%20List/Test%20Folder/ as I would suppose, but it is /Custom%20List/33_.00

I tried also the following body without success:

{ "__metadata":{"type": "SP.ListItemCreationInformation" },"FolderUrl":"/Custom List/Test Folder/","UnderlyingObjectType":1, "LeafName":"Test Folder"}

SharePoint return the following Error Message: "Es wurden inkompatible Typarten gefunden. Der Typ "SP.ListItemCreationInformation" hat die Art "Complex", es wird aber "Entity" erwartet."

Does somebody know, how to successfully create a folder within a simple list (NOT a library!)?

Thanks in advance!

Upload very large file to SharePoint Online

$
0
0

Hi,

I tried uploading very large files to SharePoint online via the REST API using JAVA. Uploading files with a size of ~160 mb works well, but if the filesize is between 400mb and 1,6 gb I either receive a Socket Exception (Connection reset by peer) or an error of SharePoint telling me "the security validation for the page is invalid". 

So first of all I want to ask you, how to work around the security validation error. As far as I understand the token, which I have added to my X-RequestDigest header of the http post request seems to be expired (by default it expires after 1800 seconds). Uploading such large files is time consuming, so I can't change the token in my header while uploading the file. How can I extend the expiration time of the token (if it is possible)? Could it help to send post requests with the same token continuously while uploading the file and therefore prevent the token from expiration? Is there any other strategy to upload such large files which need much more than 1800 seconds for upload?

Additionally any thoughts on the socket exception? It happens quite sporadically. So sometimes it happens after uploading 100 mb, and the other time I have already uploaded 1 gb.

Thanks in advance!


Using QueryTemplate in SP 2013 SharePoint Hosted App REST API

$
0
0

Hi,

I am trying to create a REST API in my Sharepoint hosted app which return the documents which are modified in last 5 days

My REST API without the date condition is

/_api/search/query?querytext='*'&sourceid='8413cd39-2156-4e00-b54d-11efd9abdb89'

where sourceId is the ID of Result Source

In order to implement the above date condition, I tried giving the querytemplate parameter in the REST API as shown below. However this doesnt return the required results.

/_api/search/query?querytext='*'&sourceid='8413cd39-2156-4e00-b54d-11efd9abdb89'&queryTemplate='LastModifiedTime>{Today-5}'

Am I missing something here ? Also, How do we use the queryTemplate in REST API ?

Regards,

Yeshwanth HV


Programatically Installing App from App Catalog

$
0
0

Hi,

    Is there any way to install Sharepoint App from App Catalog using powershell, C# , CSOM/JSOM?  We have some Sharepoint App are deployed on enterprise catalog and we want to install them on number of sites programatically.

    I look at Import-SPAppPackage but it needs .app package.

-Shreyas Ranade


Shreyas Ranade (MSFT)

I have get error 404 when i create provisioning site collection


Storing Non Seriablizable Object in Azure Redis cache

$
0
0

Hello, 

After the end of support of Auto Hosted App, i performed the migration of my App to Provider hosted.

Everything goes fine but I'm stuck with the new Azure redis cache use.

In Autohosted App, I could store non serializable objects in in ASP.NET Session with HttpContext.Current.Session.Add(key, obj)

 - Microsoft.SharePoint.Client.User object (not Seriablizable) 

 - SharePointContextToken (not Seriablizable)

My first question is why it worked  ?

My second concerns is that the new Azure Redis Cache throw exception when I try to store this non serializable obects.

Is there a solution to solve this problem ?



File Upload error from Remote Application

$
0
0

Hi All

I have an SharePoint 2013 server with a Document library. I have created a simple MVC (ASP.net) application that is hosted on another server (IIS7 Server) that uses CSOM to upload a file from the client machine to SP library using this article. When I test on my local machine the file upload but when I publish the MVC application to the Remote Server I get the following error:

System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\aaa.txt'. File name: 'c:\windows\system32\inetsrv\aaa.txt'   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)   at System.IO.FileStream..ctor(String path, FileMode mode)   at SimpleUpload.Controllers.HomeController.Index(FormCollection frmCollection)

The file I try to upload is aaa.txt and is located on my c:\ drive. I suspect it has something to do with the memory stream of the remote server ? but not sure.

Thanks in advance.

Francois

Where have ListItemVersionCollection and ListItem.Versions gone?

$
0
0

Hi,

I'm using VS2013 connecting to a SharePoint 2013 online (developer site).

I can view listItems using C# CSOM without a problem. But I wanted to see if I could get to previous ListItem versions. But listItem.Versions is not available:

( 'Microsoft.SharePoint.Client.ListItem' does not contain a definition for 'Versions' and no extension method 'Versions' accepting a first argument of type 'Microsoft.SharePoint.Client.ListItem' could be found (are you missing a using directive or an assembly reference?)")

Additionally, SPListItemVersion (ListItemVersion) and SPListItemVersionCollection (ListItemVersionCollection) are unavailable too. (After an extensive search, I've also tried going via the ListItem.File method, without success.)

So, any suggestions as to how I could get to a previous version of ListItem? Or is there something wrong with my version of VS2013?

Thanks.

Add Custom Field to Default View using REST

$
0
0

I tried to create a List through REST API , I was able to achieve it. So when I create a new custom field through REST it does not appear in the default VIEW. Is there any Way to make that field visible in the default view ? Is there any parameter except these that I need to add ,

JSON.stringify( {
  '__metadata': { 'type': 'SP.Field' },
  'Title': '_Currency2',
  'FieldTypeKind':10,
  'Required':false,
  'EnforceUniqueValues': 'false',
  'StaticName': '_Currency2',
  })

Uploading Access Web App to Sharepoint

$
0
0

Greetings,

A very basic question here, but it is driving me nuts. I am trying to upload an access web app to our sharepoint and I get an error message stating that the server name is mistyped. I get that error message after I type my username and password, so I know access is talking to our sharepoint yet I can't upload. I know Access services are running in our environment because there are other Access Web Apps running uploaded by the previous SP admin... what am I missing? Am I suppossed to have admin access to a site, or having owner access will be enough?


Thanks for your help!
Oliver

SP.RequestExecutor fails when using Internet Explorer 9

$
0
0

SP.RequestExecutor fails when using Internet Explorer 9

Error message is:

"Your browser doesn't support some HTML5 features like the File API operations. Please use a browser that does support these features."

SP.RequestExecutorRes.rE_BrowserBinaryDataNotSupported


http://screencast.com/t/H12Cf59NTvD


http://www.getcodesamples.com/src/6202B397/91B21D55


Unable to Add LightSwitch App as (Autohosted) to Site Collection on Office 365- SharePoint

$
0
0

I had created a light-switch 2013  app using SharePoint List.

And Successfully deployed, published as auto-hosted app.

And uploaded  App Catlog (Apps for SharePoint), but while adding app (on click of Trust this), its work but app is not added to site collection. Getting the below error message. 



How to resolve this any help will be appreciated.


How Do You set permission to be able to use the Live Tiles app on a Public Facing SharePoint - O365 Online Site?

$
0
0

Hello,

I am now using the Live Tile App on my sharepoint o365 online site. It works fantastically.

The app is here ... http://office.microsoft.com/en-us/store/results.aspx?qu=live+tile+sharepoint+app&ex=1&av=osu150

it works famously and I can see it fine if I access with https:// but it will not render if accessing the page http:// I have set the sharepoint group of visitors for security to be able to view but it will still not show. Does anyone know how to open this up for public facing view. Step By Step instructions for a SharePoint Online / O365 site is deperately needed or guidance on where I can find help is much appreciated! -- Thanks ... Tone'http://eQualityITsolutions.com

Sharepoint Online public facing site-Users feedback

$
0
0
Recently i have saw the sharepoint contact us app in here . This app enable the option users can able to enter some details without login. Now i want create one app like this for getting some input from the user with out login. how can i do this?

Custom actions with apps when "app stapling"

$
0
0

I have a provider hosted app that I have created a custom action for that displays in the ribbon for document libraries in the host web to take the user to the app.

I want this app to be available on every site so I installed it in the App Catalog and used the deployment option to have it automatically deployed to every site in my tenant in SharePoint online. Doing this the app does appear in every site but the custom ribbon button doesn't.

The only way the ribbon button appears is where I manually install the app (again from the app catalog), but this is unfeasible for my case due to the number of sites

Do I need to do something else to get this to work, or is this a bug/expected behaviour?

Thanks

David

email integration

$
0
0
sir,
i want the users to open and send their mails through office 365 portal and it should be single sign-on. and i want to present it in a web part is it possible. please help.

‘Post-deployment Command Line’. snap-in ‘Microsoft.SharePoint.PowerShell' is not installed on this computer.

$
0
0

Hi All,

I am try to run a PowerShell script automatically when deploying a SharePoint Farm solution, but keep receiving error messages.

I first create a SharePoint folder called PowerShell Scripts and place my PowerShell script into it (SPDeploy.ps1).

*************

SPDeploy.ps1:

                

$snapin = get-pssnapin | where { $_.Name -eq "Microsoft.SharePoint.PowerShell" }

if($snapin -eq $null)  {

Add-PsSnapin Microsoft.SharePoint.PowerShell

}

write-host "RESET IIS"

iisreset

write-host "DELETE DEMO SITE"

Remove-SPSite -Identity "http://mySite/Sites/Test1" -GradualDelete -Confirm:$False

write-host "CREATE DEMO SITE"

New-SPSite http://mySite/Sites/Test1 -OwnerAlias "Domain\Administrator" -Name "Contoso" -Template "SiteDefinition1#0"

write-host "FINISHED"

***************

I then add commands into the Visual Studio ‘Post-deployment Command Line’. I have tried three different commands, but I still received error messages.

Command 1)
%SystemRoot%\syswow64\WindowsPowerShell\v1.0\PowerShell.exe set-executionpolicy -executionpolicy unrestricted

%SystemRoot%\syswow64\WindowsPowerShell\v1.0\PowerShell.exe -file "$(ProjectDir)\PoweShellScripts\PSDeploy.ps1"

Command 2)

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe set-executionpolicy -executionpolicy unrestricted

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -file "$(ProjectDir)\PoweShellScripts\PSDeploy.ps1"

Command 3)

%windir%\System32\WindowsPowerShell\v1.0\powershell set-executionpolicy unrestricted -file "$(ProjectDir)\PoweShellScripts\PSDeploy.ps1"

%windir%\System32\WindowsPowerShell\v1.0\powershell -file "$(ProjectDir)\PoweShellScripts\PSDeploy.ps1"

While deploying the SharePoint solution I get the error message shown below:

*****************

Add-PsSnapin : The Windows PowerShell snap-in ‘Microsoft.SharePoint.PowerShell' is not installed on this computer.

At C:\Users\Administrator\Documents\Visual Studio 2013\Projects\SharePointSiteProj\SharePointSiteProj\PoweShellScripts\PSDeploy.ps1:7 char:1

+ Add-PsSnapin Microsoft.SharePoint.PowerShell

    + CategoryInfo         : InvalidArgument: (Microsoft.SharePoint.PowerShell:String) [Add-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

remove-spsite : The term 'remove-spsite' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the

name, or if a path was included, verify that the path is correct and try again.

At C:\Users\Administrator\Documents\Visual Studio 2013\Projects\SharePointSiteProj\SharePointSiteProj\PoweShellScripts\PSDeploy.ps1:21 char:1

+ remove-spsite -Identity "http://robin/Sites/Test2" -GradualDelete

-Confirm:$Fals ...

    + CategoryInfo         : ObjectNotFound: (remove-spsite:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

*****************

I can run the same script manually from a SharePoint PowerShell console without any error message, but would like it to run automatically from the Visual Studio ‘Post-deployment Command Line’.

I hope you can help
Colin




Viewing all 8089 articles
Browse latest View live


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