10

I ultimately ended up just using a foreach loop to iterate through the SPWeb.Lists collection and then check each list's BaseTemplate value to get all the picture and asset libraries. Code provided below: private void PopulateImageLibraryDropDownList() { base.EnsureChildControls(); _dropDownList.Items.Clear(); _dropDownList....


9

I read that sandbox solution is not preferred in SharePoint 2013 and we should use the app model. So is creating artifacts an available approach to do inside SharePoint apps? Yes there are multiple available approaches. The one I use the most is (for provider hosted add-ins) to use a remote event receiver on AppInstalledevent. In the event receiver you can ...


5

This is how to check for sandbox: if(System.AppDomain.CurrentDomain.FriendlyName.Contains("Sandbox")) { // I'm in a SandPit } This is how to check for SPO: if(SPContext.Current.Web.siteClientTag.contains("$$16")) { // I'm in the clouds } Mystery solved!?!


5

As you have discovered SPLimitedWebPartManager is not availabe on Sandboxed solutions. Snippet from Waldek Mastykarz blog: Inconvenient provisioning Web Parts instances from Sandboxed Solutions One of the challenges when working with Sandboxed Solutions is how to provision Web Parts instances to pages. If you have done this before in a Farm ...


5

I no in your post you said "without an external application" but does that include js libraries? Below is a simple solution that will copy a document from one SP library to any other SP library. I have not verified its cross-site scripting capabilities but it theoretically should work across farms, domains, and different SP versions. (It 100% works across ...


4

It's related to the sandbox, because you cannot use SPFolder.ContentTypeOrder and SPFolder.UniqueContentTypeOrder in sandbox :\ Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll) Available in Sandboxed Solutions: No Edit: If it's just to order, the code posted as an answer by James in this question might work.


4

Well it's taken a few days but I've finally managed to work this one out however it did involve me having to dissect the whole project and reintroduce each piece one at a time. A few issues were causing it:- 1) I had set one of the projects "Include Assembly in Package" property to false. 2) A static method was making a call to an SPList which turned an ...


4

You cannot use the SharePoint root folder, nor any of its sub folders. However, you can deploy an aspx file to the content database using a module. Look at the solution here: http://spkbase.codeplex.com That solution also uses the SPUserCodeWebPart to run server-side code on those aspx pages.


4

This sort of task is more suited to an event receiver. The itemAdded approach will certainly give you access to the ID. An event receiver does not have the typical delay you see with Workflows, it fires right away. One issue you can experience with ItemAdded events is that they run asynchronously. What this means is that the control is returned to the UI ...


4

Using a pure Sandboxed solution this is not possible. A sandboxed solution has absolutely no access outside the current site collection, that's the whole point of sandboxed solutions. On-premises If you're solution is developed for on-premises SharePoint where it's "just" politics which require the solution to be Sandboxed. Then there is the possibility of ...


4

Are there only 2 kinds of SharePoint Solutions? yes, but since SP 2013 we could count the APPs as a separate solution type as well Does the SharePoint Foundation Sandboxed Code Service" (SPUserCodeV4) have to be active ... yes On what server(s) should...Code Service" (SPUserCodeV4) be active? I would suggest on the front end "Save Site as ...


4

APPROACH 1 First add reference of two COM components. Microsoft Office Object Library Microsoft Excel Object Library excel = new ApplicationClass(); excel.Visible = false; string workbookPath = url; Workbook excelWorkbook = excel.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, XlPlatform.xlWindows, "", true, false, 0, true, false, false); Sheets ...


4

There has been an outage listed in the admin portal for most of the week regarding sandboxed solutions: SP73009 - Custom Solutions and Workflows - Service degradation Service degradation - Jul 27, 2016 3:50 PM Current Status: We're continuing to perform a detailed analysis of the issue to determine the next steps. User Impact: Users may be ...


4

As far as I have information, I doubt anything will change with respect to farm solutions. They exist since the first version of SharePoint and are the most powerful way to develop solutions in SharePoint. Among other things: Better performance Code more "ordered" Compiled code Simpler to use Elevated privileges More classes It does not seem that this ...


4

I think, the code-based sandbox solutions are no longer going to work in SP 2019. It's one of the most promitent things removed in the latest sever version of the product: After careful consideration, we've decided to also remove support for code-based sandbox solutions in SharePoint Server 2019. Customers are recommended to explore SharePoint add-ins as an ...


3

Yes, it is possible (see here too http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemadded(v=office.14).aspx), however you would need to be aware of some tips, such as: make sure you don't use any RunsAsPrivilegedUser debugging always by attaching to SPUCWorkerProcess


3

I have the exact same problem. Unfortunately, it doesn't look like it's possible to use a .webpart file for the wrapper web part, SPUserCodeWebPart, since the GetTypeId method in the SafeControls class in SharePoint explicitly checks for this and throws an exception if you try as evidenced by the following reflected code: // Microsoft.SharePoint....


3

For client side stuff I came up with the following check: if (typeof O365 === "undefined"){ // I'm executing in the context of SharePoint on-prem. } else{ // I'm executing in the context of SharePoint Online. }


3

You can't deploy anything to any mapped folders in Sandboxed solutions. A Sandboxed solution cannot place physical files in the LAYOUTS virtual directory - it's just one of their limitations. What you'll need to do is to add your images to a Module SPI folder in Visual Studio, and have the Solution deploy the module (and the files contained within) to a ...


3

You cannot deploy application pages to the 15 hive with a sandbox solution because the access is blocked. You can however, create application pages by using Modules for deployment. See this link: http://www.wictorwilen.se/Post/Custom-application-pages-in-the-SharePoint-2010-Sandbox.aspx


3

Depending on where you store the files, you may not have access to them. Sandbox solutions do not have access to the local file system (see more restrictions here: http://msdn.microsoft.com/en-us/library/gg615454.aspx#BKMK_LowPrivilegeToken). You would have to store the files in a library to gain access to them.


3

Well you could indeed rely on using the Delay Activity to which you set proper execution time, and always updating when to run next, etc. - but really Workflows are not meant to be used instead of Timer-Jobs. A better alternative would be keep this delay to a minimum by using a certain flag on the list which by modifying would actually trigger the Workflow ...


3

There is no way to deploy a Web Service as part of a Sandbox solution. Sandboxed solutions can't provision anything directly to IIS/File system. If you need a solution which will work similar with both SharePoint 2010 and 2013 then your best option would be to host the Web Service completely outside SharePoint (could be on Azure or your own servers) and ...


3

User form templates that contain code can be published by site collection administrations to form libraries as sandboxed solutions. For more information about sandboxed solutions, see Sandboxed solutions overview (SharePoint Server 2010). Form templates that require full trust or use a data connection that is managed by an administrator must be deployed by ...


3

take a look at this article in MSDN. It'll outline to you the procedures and limitations about localizing Sandboxed solutoins (same applies to SP 2013): Localization of Sandboxed Solutions in SharePoint 2010


3

Strangely enough, this fixes the problem for me on SharePoint 2013 instance installed on a Windows Domain Controller: Set-SPLogLevel -Identity "SharePoint Foundation:Sandboxed Code Service" -TraceSeverity "Verbose" Restart-Service -Name "SharePoint User Code Host" Of course, I only use this in a non-production environment.


3

I'll be honest - your vendor should be taking into account your current and projected platforms, as well as your branding requirements and Informing you what the best option is. Your future hosted provider may or may not support Apps and/or sandbox solutions. These are configurable and can be turned off. If you are looking at O365 - then both are ...


3

I think the Powershell commandlets you are looking for are: Disable-SPFeature, which is the equivalent of going to the "Manage Site Features" page and clicking the "Deactivate" button. Disable-SPFeature has a Force parameter, and a URL parameter which: Specifies the URL of the Web application, site collection, or Web site to which the Feature is being ...


3

Code in sandboxed solution has been depricated by Microsoft in SharePoint Online for some time now, see Deprication of custom code in sandboxed solutions. So that is the most possible reason for what you are experiencing. They are now starting to enforce the no-code-policy, here is new information backing up this statement: Removing code based sandbox ...


3

As per the Microsoft, as shown in the Admin > Service Health currently SharePoint Online service is degraded. Next Update from Microsoft will be on Monday, August 1, 2016, at 8:00 PM UTC. Check the service health.


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