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

When clicking on the app its redirects to the "Page Cannot be displayed" page

$
0
0

Hi Folks,

I have been working with SharePoint Apps development using visual studio, I had developed a SharePoint hosted app and deployed to App catalog, Also added to site but when i click on that app its redirecting me to page saying that "Internet Explore cannot display the page" but the when i look at url its in my app catalog only(i.e App Domain), can anybody help me on this.,

Thanks in advance for you time.


Office 365 SharePoint - "Sorry, only tenant administrators can add or give access to this app"

$
0
0

Hello,

I'm have registered Office 365 Small Business Premium subscription. I'm the only user (I'm using same account that has been used to subscribe for O365).

My target is to develop an App that can Access SkyDrive Pro using the SharePoint 2013 APIs.

As is mentioned in article, I need to request "AllSites.Read" access when I do OAuth authorization request. BUT, once I do specify AllSites.Read scope in authorization request, I see red message saying: "Sorry, only tenant administrators can add or give access to this app." and "Trust It" button is disabled, "Cancel" is only available option.

Also I'm getting the same error when I request permission scope "http://sharepoint/content/tenant" registering my app on ~/_layouts/15/appinv.aspx page following MSDN instructions.

I have found various articles about how to assign and manage tenant administrators in sharepoint on premise version, but nothing regarding cloud version.

Could you please advise?

Thanks,

Dennis Tretyakov

Query a remote service using the web proxy in SharePoint 2013

$
0
0

I am referring this MSDN article and trying to access remote public web service to get data in my SharePoint hosted app. http://msdn.microsoft.com/en-us/library/fp179895%28v=office.15%29.aspx

after going through all steps and running the app , I am getting the error

Status code: 403 The size of the response from the remote endpoint exceeds the configured limit.

Anyone has any idea about reason for this error?

Is there some other way using which I can access remote web service in my app? I need to call a web service method which takes a parameter and returns result. stuck on finding syntax for calling web service with input parameter to method. any guess will be helpful.


Bhushan | http://www.passionatetechie.blogspot.com | http://twitter.com/BhushanGawale


Problem with a basic SharePoint Hosted App ( appredirect.aspx?clientid= )

$
0
0

Hi,

I have been creating a basic sample SP Hosted App

Dev deployment: everything worked OK while I was doing a Dev deployment from Visual Studio.

However, when I tried to Retract and actually install the app in the App Catalog on my local SP2013 server then I get problems.

The App loads up fine, the App shows up in my SharePoint user site and I can choose Add an App.

However when it finishes provisioning the app is not found.

The URL looks a bit different from normal:

http://server/_layout/appredirect.aspx?clientid=xxxxx

(normally this would say  ?instanceid=yyyyy )

Does anyone know what I might be doing wrong?

The same code seems to work fine on a different dev box, I have check all the host file settings and the appservice and subscription service are running ok.

Any suggestions? Thanks

R.


Ruth, UK

Tracking document sharing

$
0
0
Is it possible to check if a user has shared a document publicly or outside the domain?

Infopath issue with dataconnection : The following data connection (GetUserProfileByName) has exceeded the maximum configured time limit. This threshold can be configured by using the SPIPFormsService -MaxDataConnectionRoundTrip PowerShell commandlet

$
0
0

Iam using a OOB webservice in my infopath and it is working in my dev machine but, when it has been moved to QA it is giving the below error.

The following data connection (GetUserProfileByName) has exceeded the maximum configured time limit. This threshold can be configured by using the SPIPFormsService -MaxDataConnectionRoundTrip PowerShell commandlet.

Please help.

thanks in Advance.

Lync user presence in Provider hosted apps

$
0
0

Hi,

I want o display the user presence in SharePoint provider hosted app, any help please?

Thanks,

-Sendil M

The name 'SharePointContextProvider' does not exist in the current context.

$
0
0

Hi to all ,

I created autohosted app and i also created custom list in office 365. Now when i insert the item in list using CSOM than i got that error " The name 'SharePointContextProvider' does not exist in the current context". 

I am using that code --

var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
using (var clientContext = spContext.CreateUserClientContextForSPHost())
            {
                  List list = clientContext.Web.Lists.GetByTitle("ListName");
                  ListItemCreationInformation info = new ListItemCreationInformation();
                  Microsoft.SharePoint.Client.ListItem item = list.AddItem(info);
                  item["Title"] = "item1";
                  item["AuthorName"] = "authorName1";
                  item.Update();

                  clientContext.Load(item);
                  clientContext.ExecuteQuery();

           }





403 Forbidden message in SharePoint after deploying App Part for Anonymous Users

$
0
0

I'm Building High-Trust Application for SharePoint on Premises for a Public Facing Internet Site. I've Created an Empty App Part and deploy it to the SharePoint. The App Part is Working fine for authenticated users but when try to access the site as anonymous I'm Receiving "403 Forbidden Error Message". This is Although I can access the page that is displayed in the App Part anonymously without any Problem.

Update:The Problem is only in the page that has the App Part. other SharePoint pages are working fine even anonymously.

Can any one support in this.

"Sorry, this app is not supported on your server" on a simple SharePoint-Hosted App

$
0
0

Hi,

I built a simple SharePoint-Hosted App with an Asset Library, a few pages with JSOM calls and an app part.

The app doesn't have any permission requests, nor any prerequesties configured in the AppManifest. Actually, nothing special.

I successfully published my App on the store, and got it approved.

The problem is that now that I can see it in the store, but I still can't install it neither on Office 365, nor on my on-premises Platform. There seem to be a few Apps in this case, and others that work.

On Office 365, I do see the App but it is greyed out with the "You can't add this app here" message. I still can go to the App détails page though, but a "Sorry, this app is not supported on your server." is displayed and I cannot add it.

On SharePoint 2013 on-prem, I can also see the App, and it is also greyed out. That time, when I go on the App détails page, I'm getting a "An unexpected error has occured" message.

Anybody had the same problem ? Or has any leads on that problem ?

Thanks !

Christian

API methods to enable sharing options for site collections within an office 365 tenant

$
0
0

We have an app (on Office365 tenant) for Self-Service Site Provisioning.   The external sharing options is enabled by default at the tenant level. However, when we provision sites using the app the "External sharing" option is not enabled at the site collection level. is there an API method to enable external sharing for site collections ?. (Same as share a site with external users by using the UI  option)  

Thanks,

Mohan

Where is the .svc file (service file) for a Sharepoint app (Remote Event Receiver) installed when you deploy to an App Catalog on SP2013 online?

$
0
0

I am trying to create a remote event receiver that I can apply to an existing SharePoint list.  

My initial motivation for doing that was because I couldn't get the List I created in my SharePoint App to display picture URLs as images rather than hyperlinks.  I figured that out: you can edit the Schema.xml for the List object with the XML editor, search for the <Field> object for the field, and add Format="Image" to it.  

However, I'm still not entirely satisfied with deploying the List in the SharePoint App.  Some of the functionality (like editing the Edit form and the Display form in InfoPath) aren't present in the List Ribbon for a List deployed as a SharePoint app. I suspect there's a way to customize those in the SharePoint app as well, but right now I'd rather just add behavior to an OOTB SharePoint list if I can.

I have created a Remote Event Listener and tested it on my SharePoint App List:

I have created an App Catalog on my SharePoint 365 dev installation:

I am now trying to use the Remote Event Listener on an arbitrary list in my root page:

As part of that, I added support for running code when my SharePoint App is installed using an App Event Receiver:

I added code in the AppInstalled handler to find the list I want to add the RER to and add a receiver to it:

void InstallRemoteEventReceiver(ClientContext context) {
    var list = context.Web.Lists.GetByTitle("Picture Reference");
    InstallForEvent(EventReceiverType.ItemAdded, list);
    InstallForEvent(EventReceiverType.ItemUpdated, list);
    context.ExecuteQuery();
}
void InstallForEvent(EventReceiverType receiverType, List list) {
    var eventReceiver = new EventReceiverDefinitionCreationInformation {
        ReceiverName = receiverType + "OnPlantUpdated",
        EventType = receiverType, ReceiverAssembly = Assembly.GetExecutingAssembly().FullName,
        ReceiverClass = "OnPlantUpdated",
        ReceiverUrl = "https://mysite.sharepoint.com/Services/AppEventReceiver.svc", SequenceNumber = 1000
    };

    list.EventReceivers.Add(eventReceiver);
}

The RER does not appear to run when I add or edit an item in my "Picture Reference" list.  

I suspect the problem is the path to the svc file in ReceiverUrl, although (since I can't really debug it) I have no idea.  I'm sure there could be any number of things that I could be doing wrong that would prevent the RER from running.
Here are some the values I've tried for ReceiverUrl without success:

- ~remoteAppUrl/Services/OnPlantUpdated.svc
- ~remoteAppUrl/Services/AppEventReceiver.svc
- ~remoteAppUrl/OnPlantUpdated.svc
- ~remoteAppUrl/AppEventReceiver.svc
- OnPlantUpdated.svc
- AppEventReceiver.svc
- https://mysite.sharepoint.com/OnPlantUpdated.svc
- https://mysite.sharepoint.com/AppEventReceiver.svc
- https://mysite.sharepoint.com/Services/OnPlantUpdated.svc
- https://mysite.sharepoint.com/Services/AppEventReceiver.svc

The Url tag specified in Elements.xml for the RER is ~remoteAppUrl/Services/OnPlantUpdated.svc:

<Receiver><Name>OnPlantUpdatedItemAdding</Name><Type>ItemAdding</Type><SequenceNumber>10000</SequenceNumber><Url>~remoteAppUrl/Services/OnPlantUpdated.svc</Url></Receiver>

The InstalledEventEndpoint specified in AppManifest.xml is ~remoteAppUrl/Services/AppEventReceiver.svc.  So I wasn't quite sure what the deployed .svc file name would actually be.

I also tried packaging the app and deploying it to my App Catalog, in case the issue was that the service URL wouldn't be available while the app was simply in the "Apps in Testing" list.  That didn't seem to help either.

I used SharePoint Designer 2013 to look at "All Files" for the site, and didn't see the svc file in there.

So my main question is: where does the service file live when the app is published?

And the secondary question is: anyone see anything wrong with this approach?

Thanks,

David Cater


Upgrading FieldChoice.Choices fails in app upgrade event handler

$
0
0

I have written a provider hosted app for SharePoint 2013 that uses custom lists and site columns in the appWeb... The application has both installed and upgraded app events implemented.

My problem is that is need to add a "Choice" to a specific FieldChoice site column in a custom list.  When I make that changes in my application and deploy upgrade the new choice does not appear (new fields however do appear in the list). 

In an attempt to get around the issue I added logic to the app upgraded event to grab the field from the list and replace the choices with the new values.  On upgrade this throws an error: "Field name already exists. The name used for this field is already used by another field in the list.  Select another name and try again."  Interestingly the same code called from the app installed event handler passes and does add the additional choice to the field.

Code Snippet: (please exuse the extra "loads".. I have been banging on this for a while now!

       public void ensureFieldChangesAreApplied(ClientContext context)
        {
            try
            {
                Web site = context.Web;
                List list= site.Lists.GetByTitle("List Name");
                FieldCollection fields = list.Fields;
                context.Load(list);
                context.Load(fields);
                context.ExecuteQuery();
                Field field = fields.GetById(new Guid(strFieldGuid));
                context.Load(field);
                context.ExecuteQuery();
                FieldChoice fcField= context.CastTo<FieldChoice>(field);
                fcField.UpdateAndPushChanges(true);
                context.Load(fcField);
                context.ExecuteQuery();
                string[] choices = { "A", "B", "C", "D_New" };
                reportedStatus.Choices = choices;
                reportedStatus.Update();
                list.Update();
                context.Load(fcField);
                context.Load(list);
                context.ExecuteQuery();
            }
            catch(Exception ex) 
            {
                Site collSite = context.Site;
                Web site = context.Web;
                List log = site.Lists.GetByTitle("Log");
                context.Load(log);
                context.ExecuteQuery();
                ListItemCreationInformation info = new ListItemCreationInformation();
                ListItem item = log.AddItem(info);
                item["Title"] = "ERROR in Field Update: " + ex.Message ;
                item.Update();
                context.ExecuteQuery();
            }
        }

Any ideas?

Thanks,

Ed

Accessing a document library programmatically

$
0
0

I can access the lists in my site with:

<a href="https:///_vti_bin/listdata.svc">https://<mysite>/_vti_bin/listdata.svc

How do I access the libraries in my site?

Your help would be much appreciated.

Thanking you in anticipation.

Roger


rogerwithnell

Is it possible to access list items in the host web from a SharePoint App Remote Event Receiver?

$
0
0

I am creating a SharePoint Online 2013 app with a list and a remote event receiver.  The goal I'm trying to achieve:

  • The custom SP app list (List A) has a lookup column that references a Site Column in a list in the host web (List B)
  • When the user adds an item to the SP app list, my Remote Event Receiver gets triggered.
  • I use information in item added to List A to retrieve an item in List B and update some columns in List B's item.

To make that a bit more concrete, think of List B as "Lending Library", and List A as "Library Requests".   When someone adds a request to List A, they have to select the item in the Lending Library (List B) that they're requesting. I want to update the item in List B to point back to the request that was added in List A, so other people can see that the item in the Lending Library has been requested.

The ClientContext that gets created when debugging the app or when it's deployed to the App Catalog appears to be for the App Web only.  I'm trying to run the following code from within the Remote Event Receiver:

var inventory = context.Web.Lists.GetByTitle("Inventory"); var query = new Microsoft.SharePoint.Client.CamlQuery { ViewXml = "<View>"+ "<Query>"+ "<Where><Eq><FieldRef Name='InventoryNumber' /><Value Type='Text'>" + invNumber + "</Value></Eq></Where>"+ "</Query>"+ "</View>" }; var items = inventory.GetItems(query); context.Load(items);

context.ExecuteQuery();

That throws an exception:

Microsoft.SharePoint.Client.ServerException: List 'Inventory' does not exist at site with URL 'https://mysite-406364b976887e.sharepoint.com/TestRemoteEventReceiver'.
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() 

I realize the SharePoint app is isolated on a separate domain for security purposes (or at least, that's my vague understanding).  I'm pretty sure my Remote Event Receiver code is running as a WCF Service hosted on the separate app web domain.  Is it ever possible to access data in the host web from a SharePoint app, which presumably would be a cross-domain call into a service running on the host web?

Thanks,

David




I get "Sorry, you don't have access to this page" when installing a SharePoint app that has a list with a lookup column onto a subsite

$
0
0

I have created a SharePoint app with a list and a remote event receiver.

I am requesting Web -> Manage permissions in AppManifest.xml.

I have deployed successfully to my root web site (https://mysite.sharepoint.com) and debugged the app.  I have also published it to a package, and then installed it on my App Catalog (https://mysite.sharepoint.com/myapps).

I can then successfully add the app to the site collection for my root web site (https://mysite.sharepoint.com) and use it.

I try to do the same thing on a subsite (https://mysite.sharepoint.com/MySubSite1).  The app installs successfully and asks me to trust it.  I do.  However, when I try to run it, I go to a page that says "Sorry, you don't have access to this page".  That pages give me a chance to request permissions. I enter a message and click "Send Request".

I then go to the root site and go to Site Settings.  In there I click on "Access Requests and Invitations".  I can see the request I just submitted.  I view the details.  I select "Full Control" in the Permission drop-down and click Approve.

This doesn't help.  When I try to run the app on the subsite I once again get the "Sorry..." message.

Any clue what I'm doing wrong?

Also, is there a way to grant a specific app specific permissions after it is installed?  My app needs permissions to a list on the root web, and there doesn't appear to be a way to request permission to the root web when installing the app on a subsite.

Thanks,

David


Autohosted App throws exception while accessing Host Web

$
0
0

Hi,

I am developing a simple auto hosted app.

It has following code  in default.aspx.cs

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);
            }           
        }

In the above code it  throws Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException exception for clientcontext object when executed. Has anyone seen this before and can help with pointers?

I am using O365 for publishing the app.

Thanks

       


-http://lrathi.blogspot.com

Access Web App - Database

$
0
0

Hello I am trying to figure out the best and easiest method of creating a database with office365.  I have read about access services and that in sharepoint 2013 the data is kept in a sql database/sql azure.  If I create an access web database and publish in sharepoint in office365, do I then have a sql database with all it's power and flexibility, or is this still an Access database with limitations compared to sql server?

Is an Access web app actually a sql database?  with a sharepoint front-end?

Also am I able to connect to the backend sql azure database with sql management studio?

Thank you much

Bad request (400) when accessing a custom document library

$
0
0

This code accesses the "Composed looks" list successfully:

            string oDataUrl = "/_api/Web/lists/getbytitle('Composed Looks')/items?$select=Title,AuthorId,Name";

            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + oDataUrl);
            request.Method = "GET";
            request.Accept = "application/atom+xml";
            request.ContentType = "application/atom+xml;type=entry";
            request.Headers.Add("Authorization", "Bearer " + accessToken);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

But if I only change the oDataUrl to get a Document library I have created:

            //string oDataUrl = "/_api/Web/lists/getbytitle('Fasthosts invoices')/items?$select=Name,Modified,ID";

            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + oDataUrl);
            request.Method = "GET";
            request.Accept = "application/atom+xml";
            request.ContentType = "application/atom+xml;type=entry";
            request.Headers.Add("Authorization", "Bearer " + accessToken);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

I get the error "The remote server returned an error: (400) Bad Request" response returned.

What am I doing wrong?

Your help would be much appreciated.

Thanking you in anticipation.

Roger


rogerwithnell

oData Url getting items from a document library

$
0
0

I have a document library with several items in it.

But when I access it programmatically with:

string oDataUrl = "/_api/Web/lists/getbytitle('invoices')/items?$select=ID,Modified";

or with:

string oDataUrl = "/_api/Web/lists/getbytitle('invoices')/items;

the code counts zero items in the library.

What am I doing wrong?


rogerwithnell

Viewing all 8089 articles
Browse latest View live


Latest Images

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